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 Exploring pandas Review Exploration Methods

2 Answers

Josh Keenan
Josh Keenan
19,652 Points
pd.read_csv('/path/to.csv', index_col=0)

Here you go, they are always on the slide before, look at the code for the answers

Josh Keenan
Josh Keenan
19,652 Points

2 seconds i will write a thing explaining how to find the stuff you need

Josh Keenan
Josh Keenan
19,652 Points

Not a bother at all, we all need help sometimes, and that's okay, just remember this is a place where you can feel comfortable asking as many questions as you feel you need to

Josh Keenan
Josh Keenan
19,652 Points

So, in this example I am going to use the question you have just asked.

pd.read_csv('/path/to.csv', __ =0)

Here is the question you have been asked. What goes in that space? To find out you first need to identify what you are looking at, in this case it is the read_csv() method. So I am just going back to the slide before and looking for the code examples of this, to find them easily I am using my browsers (Google Chrome) find feature, this can be used by hitting the CMD+F keys on a mac, or CTRL+F on a linux or windows machine (I believe it is the same shortcut in most browsers).

Then I just type in the method I am searching for, in this case read_csv(). Once I find it I look at the code examples and compare them to the question in front of me, trying to identify what is missing, I also assume generally that the order of the arguments being passed in is important, to aide me better. This way I could quickly identify that it is in fact the index_col argument that should come second.

pd.read_csv('/path/to.csv', index_col=0)