Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introduction to pandas Meet pandas Accessing a Series

Nicole Buckenwolf
Nicole Buckenwolf
8,721 Points

Just commenting about soon to be deprecated format

Not a question, just commenting in case someone else runs into this.

In line 8 when I ran balances[0] I got the following message:

/var/folders/rd/4p5s17sn30d9bp8n1v3zffg80000gn/T/ipykernel_1640/2146670924.py:2: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  balances[0]

Just commenting in case anyone else wasn't sure how to do this, as I inititally couldn't figure out how to apply - the new way to do it will look like this balances.iloc[0]

Similarly for type(balances[0]) -- use type(balances.iloc[0])

(They talk about this later in the lesson!)