axiompp
(Verc M)
September 15, 2022, 8:52pm
1
I am a newbie and am trying to get this code to write all the columns without the … in between.
uniqueValues = df.nunique()
print(uniqueValues)
I have used this code in the past it showed me all the columns, but maybe this file has too many?
Thanks!
vbrozik
(Václav Brožík)
September 15, 2022, 9:26pm
2
I am guessing df
is a Pandas DataFrame, right?
You can set options to change the output formatting. For example to not truncate the output up to 200 rows, use:
import pandas as pd # The setting works for this way of importing Pandas.
pd.options.display.max_rows = 200
For more details see:
https://pandas.pydata.org/docs/user_guide/options.html
1 Like
axiompp
(Verc M)
September 15, 2022, 9:33pm
3
I knew there was an easy solution.
I thought this would work and had this in the script, but it wasn’t solving this problem.
pd.option_context(“display.max_rows”, None) because used this in the .describe() and it worked there.
Thank you!
vbrozik
(Václav Brožík)
September 16, 2022, 6:41am
4
You are welcome.
option_context()
is a context manager. You have to use it like this:
with pd.option_context("display.max_rows", None):
...
# Put your code using that option here.
There is a similar function a for permanent change: set_option()
.