2
votes

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'

1
What version of pandas are you running? Can you post result of this print(pd.__version__)XXavier
1.0.3 do I need to update something?Brian Bergstrom

1 Answers

6
votes

After some searching, I found I was simply using the wrong methods.

idxmin and idxmax work just fine.

google.idxmax()

3011

google.idxmin()

11