Me da error lo siguiente, no sé como arreglarlo :(
for index, row in dataset.interrows():
if (2020 - row.Año != 0):
dataset.loc[index, 'km_media'] = row.Kilometraje / (2020 - row.Año)
else:
dataset.loc[index,'km_media'] = 0
dataset
AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 for index, row in dataset.interrows(): 2 if (2020 - row.Año != 0): 3 dataset.loc[index, 'km_media'] = row.Kilometraje / (2020 - row.Año) 4 else: 5 dataset.loc[index,'km_media'] = 0
/usr/local/lib/python3.10/dist-packages/pandas/core/generic.py in getattr(self, name) 5900 ): 5901 return self[name] -> 5902 return object.getattribute(self, name) 5903 5904 def setattr(self, name: str, value) -> None:
AttributeError: 'DataFrame' object has no attribute 'interrows'