4

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'

Brian Bergstrom
  • 173
  • 1
  • 8

1 Answers1

13

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

idxmin and idxmax work just fine.

google.idxmax()

3011

google.idxmin()

11

Brian Bergstrom
  • 173
  • 1
  • 8