I have a dataframe without columns names and when I print it I get a row with numbers, how can I print without this row? I have the same problem with the index, how can I print without index and columns?
Asked
Active
Viewed 2,320 times
1
-
Does this answer your question? [How to print pandas DataFrame without index](https://stackoverflow.com/questions/24644656/how-to-print-pandas-dataframe-without-index) – Chris Jul 27 '20 at 19:50
1 Answers
2
See the docs for some more info on using the to_string()
function in pandas.
print(df.to_string(index=False))
To hide the index and the column headers:
print(df.to_string(index=False, header=False))

Henry Ecker
- 34,399
- 18
- 41
- 57

DCrowley
- 31
- 3
-
Thank you! I what about the columns? as I don't have header, how can I do to avoid the row with numbers that I get when I print? – Cristina Dominguez Fernandez Jul 28 '20 at 08:23
-
-
Or if you want to set your own column headers you can set header = list of strings – DCrowley Jul 28 '20 at 11:49