Published on
· Data Independent

Pandas Set Index | pd.DataFrame.set_index()

This post is auto-generated from a public YouTube video for personal study notes. It is not an endorsement. The transcript is machine-derived and may contain errors; refer to the original video for accuracy.

About this video

Sometimes your row numbers as your index just doesn't cut it and you need to pandas set index on your DataFrame.

You may want to replace your current index with another column in your DataFrame. No problem with pd.DataFrame.set_index()!

You're usually doing this when you want to set your index to a list of names, or unique ids. For example, you imported a CSV but forgot to set your index_col.

Loading transcript…