0

what is the difference between df.head and pd.options.display ?

in machine learning the code import pandas as pd pd.options.display.max_columns = 6 df = pd.read_csv('https://sololearn.com/uploads/files/titanic.csv') print(df.describe()). what is the difference if we say ...display.max_columns=6 and print(df.head(6))

14th Aug 2021, 10:53 PM
Sumer Fattoum
Sumer Fattoum - avatar
4 Réponses
+ 1
Head is for rows, not colums. And options affects all output, head only one.
14th Aug 2021, 11:03 PM
Simon Sauter
Simon Sauter - avatar
+ 1
It affects only one *output*. If you use options it applies to all tables you print in your document. Head applies only to one table.
15th Aug 2021, 6:06 PM
Simon Sauter
Simon Sauter - avatar
0
Ok, but how do you mean head affects only one? You mean one column? Cuz we can define head( 6), and usually shows 5 rows
15th Aug 2021, 4:46 PM
Sumer Fattoum
Sumer Fattoum - avatar
0
thnx, more they say it will display all 6 columns, without the line, which line?
15th Aug 2021, 6:27 PM
Sumer Fattoum
Sumer Fattoum - avatar