top of page
Writer's pictureChris Franklin

How to Create a Pandas DataFrame with and without a index

I use pandas often in my fulltime job and in my data science personal projects. Wanted to share how to create a Pandas DataFrame with an index and without a index. With an Index: import pandas as pd testdict ={ "calories":[2,8,9], "food":["chicken","fish","vegetables"], "liquid":["water","gatorade","more water"] } testdf = pd.DataFrame(testdict) testdf Without an index: testdf.style.hide_index()



139 views0 comments

Recent Posts

See All

Accenture is acquiring Udacity

This is substantial. Udacity is renowned for their Nanodegrees. Credit to article author. https://fortune.com/2024/03/05/accenture-ceo-ju...

Comments


bottom of page