How do you see the element of a csv table with many columns (>30) which the names of its columns is more than 10 character in pandas?

How do you see in pandas the element of a csv table with many columns (25) which the names of its columns is more than 10 character? I have 5000 rows and 32 columns and the label of some columns are more than 10 characters. How I ca see them and work with different columns?

Excel does not work! All of the items are sloppy

Access is OK but could not detect the long labels of items!

What is your solution for it?

Topic data-table multiclass-classification csv pandas python

Category Data Science


I dont know which compiler you are using but mine is jupyter.

You can make wider notebook by:

from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

By doing that you can display more columns with df.head(). If you cant display still ("..." between columns), you can use iloc. For you data I used df.iloc[:5,:15] and df.iloc[:5,15:].

Also which is a better solution you can change pandas display options by:

pd.set_option('display.max_columns', 500)

Here is the screenshot of my notebook:

enter image description here

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.