How can I print pandas dataframe without column index/name? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I print pandas dataframe without column index/name?

18th Apr 2020, 2:36 PM
Ankur Singh Oli
Ankur Singh Oli - avatar
3 Answers
+ 2
Just do like this. import pandas as pd presidents_df = pd.read_csv('https://sololearn.com/uploads/files/president_heights_party.csv') print(presidents_df)
19th Apr 2020, 3:22 PM
A͢J
A͢J - avatar
+ 1
This prints the dataframe But columns have their name on the top. I don't want to print the column names, can I do that, if yes, how ?
20th Apr 2020, 4:57 PM
Ankur Singh Oli
Ankur Singh Oli - avatar
+ 1
For example if I have, Name Age 0 xyz 10 1 abc 20 I want to print 0 xyz 10 1 abc 20
20th Apr 2020, 5:01 PM
Ankur Singh Oli
Ankur Singh Oli - avatar