[PYTHON] Prevent omissions with pandas print

When you don't like it being omitted in pandas print

When you want to see the row properly

For example, iris data is 150 rows, so In such a case

pd.set_option('display.max_rows', 150)

I'll put it in.

import pandas as pd
from sklearn import datasets

pd.set_option('display.max_rows', 150)
iris = datasets.load_iris()
df1 = pd.DataFrame(iris['data'])
print(df1)

When you want to see the column properly

For example, olivetti_faces has 4096 columns, so In such a case

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

I'll put it in.

import pandas as pd
from sklearn import datasets

pd.set_option('display.max_columns', 4096)
olivetti_faces = datasets.fetch_olivetti_faces()
df2 = pd.DataFrame(olivetti_faces['data']).head()

print(df2)

Recommended Posts

Prevent omissions with pandas print
Quickly visualize with Pandas
Processing datasets with pandas (1)
Bootstrap sampling with Pandas
Convert 202003 to 2020-03 with pandas
Processing datasets with pandas (2)
Merge datasets with pandas
Learn Pandas with Cheminformatics
Data visualization with pandas
Data manipulation with Pandas!
Print debug with PyScribe
Shuffle data with pandas
Read csv with python pandas
Load nested json with pandas
[Python] Change dtype with pandas
Data processing tips with Pandas
Extract the maximum value with pandas.
Versatile data plotting with pandas + matplotlib
[Python] Join two tables with pandas
Extract specific multiple columns with pandas
1. Statistics learned with Python 1-1. Basic statistics (Pandas)
Convenient analysis with Pandas + Jupyter notebook
Draw a graph with pandas + XlsxWriter
Manipulating strings with pandas group by
Bulk Insert Pandas DataFrame with psycopg2
I want to do ○○ with Pandas
Create an age group with pandas
Excel aggregation with Python pandas Part 1
[Python] Format when to_csv with pandas
Feature generation with pandas group by
Handle various date formats with pandas