-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: displaying lots of columns #2076
Comments
You have two options;
see also:
In [41]: df = pd.DataFrame(np.random.randn(2, 20))
In [42]: df
Out[42]:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 2 entries, 0 to 1
Data columns:
0 2 non-null values
1 2 non-null values
2 2 non-null values
3 2 non-null values
4 2 non-null values
5 2 non-null values
6 2 non-null values
7 2 non-null values
8 2 non-null values
9 2 non-null values
10 2 non-null values
11 2 non-null values
12 2 non-null values
13 2 non-null values
14 2 non-null values
15 2 non-null values
16 2 non-null values
17 2 non-null values
18 2 non-null values
19 2 non-null values
dtypes: float64(20)
In [43]: print df.to_string()
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 -1.120988 -0.014668 1.005053 -1.171275 0.819571 1.376871 0.192588 0.052807 -0.847959 -1.220135 1.367997 -1.302833 1.717463 -0.306201 -0.037465 -0.067757 -1.137955 -0.508188 -0.385194 1.289037
1 -0.348980 -0.538781 0.903626 -1.481493 -1.191302 -0.509413 -0.863830 -2.581788 -0.965519 0.152339 0.039064 -0.339086 -0.114939 -1.277665 0.537978 -1.072551 -0.772296 -0.719904 0.819310 -0.422032
In [44]: pd.set_printoptions(max_columns=50)
In [45]: df
Out[45]:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 -1.120988 -0.014668 1.005053 -1.171275 0.819571 1.376871 0.192588 0.052807 -0.847959 -1.220135 1.367997 -1.302833 1.717463 -0.306201 -0.037465 -0.067757 -1.137955 -0.508188 -0.385194 1.289037
1 -0.348980 -0.538781 0.903626 -1.481493 -1.191302 -0.509413 -0.863830 -2.581788 -0.965519 0.152339 0.039064 -0.339086 -0.114939 -1.277665 0.537978 -1.072551 -0.772296 -0.719904 0.819310 -0.422032 |
I'd be willing to basically "take the R approach" of wrapping columns. Have to take a look |
I've been using the approach mentioned above, but obviously R's implementation is much easier to read for high-dimensional datasets. Thanks!
|
@changhiskhan , wide repr closed this? |
Yup go ahead and close
|
I saw the ipython notebook on twitter, the update is pretty slick! Just two quick questions:
Thanks! Vishal |
|
Probably possible to add an option at some point for #2 (would be nice for interactive stuff) |
Hi,
What's the plan for displaying head() cleanly on my dataframe when there are lots of columns?
R handle's this easily by wrapping the output across multiple lines.
Thanks,
Vishal
The text was updated successfully, but these errors were encountered: