๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Python/Pandas

[Pandas] Dataframe ์ „์ฒด ์ถœ๋ ฅํ•˜๊ธฐ

๋ฐ˜์‘ํ˜•

 

 

import numpy as np
from sklearn.datasets import load_iris
import pandas as pd
 
# Loading irirs dataset
data = load_iris()
df = pd.DataFrame(data.data,
                  columns = data.feature_names)
display(df)

 

 

import numpy as np
from sklearn.datasets import load_iris
import pandas as pd

data = load_iris()
df = pd.DataFrame(data.data, 
				columns = data.feature_names)

# The scope of these changes made to
# pandas settings are local to with statement.
with pd.option_context('display.max_rows', None,
					'display.max_columns', None,
					'display.precision', 3,
					):
	print(df)

 

 

import numpy as np
from sklearn.datasets import load_iris
import pandas as pd

data = load_iris()
df = pd.DataFrame(data.data,
				columns = data.feature_names)

# Permanently changes the pandas settings
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
pd.set_option('display.max_colwidth', -1)

# All dataframes hereafter reflect these changes.
display(df)

print('**RESET_OPTIONS**')

# Resets the options
pd.reset_option('all')
display(df)

 

 

 

 

https://www.geeksforgeeks.org/how-to-print-an-entire-pandas-dataframe-in-python/

 

How to print an entire Pandas DataFrame in Python? - GeeksforGeeks

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

www.geeksforgeeks.org

 

๋ฐ˜์‘ํ˜•