I am learning about python/pandas attributes in a Series. I can get it to display the min and max values, but I want to display the min and max index values and I get an error message.
google.min()
49.95
google.max()
782.22
google.idmin()
AttributeError Traceback (most recent call last) in ----> 1 google.idmin(True)
/opt/anaconda3/envs/pandas_playground/lib/python3.8/site-packages/pandas/core/generic.py in getattr(self, name) 5272 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5273
return self[name] -> 5274 return object.getattribute(self, name) 5275 5276 def setattr(self, name: str, value) -> None:AttributeError: 'Series' object has no attribute 'idmin'
After some searching, I found I was simply using the wrong methods.
idxmin and idxmax work just fine.
google.idxmax()
3011
google.idxmin()
11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With