Last answered:

12 Jul 2020

Posted on:

08 Jul 2020


How to extract an index from a DataFrame?

Dear Team,
Could you please help me on this,
I am extracting some data from WebScrapping, but i need to take the dates from the info that i am receiving. I need the Datetime, but it seems to be in the index, do you know how to get it?
This is saved in a Dataframe called data.


1 answers ( 0 marked as helpful)
Posted on:

12 Jul 2020

Hi Miguel! Thanks for reaching out. Please accept my apologies for the delayed response. You can use the .index attribute to obtain an index object containing the index values. Also, you can use indexing on top of using this attribute to obtain a specific value from the index - .index[]. For instance, you can use .index[0] applied to the relevant DataFrame. Hope this helps.

Submit an answer