The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Anybody can ask a question
Anybody can answer
The best answers are voted up and moderated by our team

How to extract an index from a DataFrame?

How to extract an index from a DataFrame?

Super Learner

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 Answer

365 Team

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.