alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
num = range(300)
df = pd.DataFrame({i:num for i in alphabet})
df
위 코드를 실행 시켜보면
위처럼 가운데가 생략되는데, 이때
# 방법1
pd.options.display.max_rows = None # 모든 행 출력
pd.options.display.max_columns = None # 모든 열 출력
# 방법2
pd.set_option('display.max_rows', None) # 모든 행 출력
pd.set_option('display.max_columns', None) # 모든 열 출력
display.max_rows와 display.columns의 설정값을 기존에는 10,20 이런식이었는데 None으로 설정해주면서 전체 출력을 해준다.
만약 출력하고 싶은 행, 열의 개수를 지정해주려면
# 방법1
pd.options.display.max_rows = 30
pd.options.display.max_columns = 20
# 방법2
pd.set_option('display.max_columns', 30)
pd.set_option('display.max_rows', 20)
'python' 카테고리의 다른 글
[python] 데이터프레임,list 파일로 저장하는법 (0) | 2023.04.18 |
---|---|
[python] 전처리 (0) | 2023.03.10 |
[python] 파이썬 팁 (0) | 2023.03.07 |