SyntaxFix
Write A Post
Hire A Developer
Questions
You can use df.index to access the index object and then get the values in a list using df.index.tolist(). Similarly, you can use df['col'].tolist() for Series.
df.index
df.index.tolist()
df['col'].tolist()