python - Fill in data elided with "..." in output from pandas.DataFrame.corr()
问题描述
When I run a command in Python like
import pandas as pd
dt = pd.read_csv("C:/Code/StudentsPerformance.csv")
dt.corr()
I get some of the data in the results
t_gender ... writingscore
t_gender 1.000000 ... 0.301225
t_race 0.001502 ... 0.165691
t_parentallevelofeducation -0.028383 ... -0.192338
t_lunch 0.021372 ... -0.245769
t_testpreparationcourse NaN ... NaN
mathscore -0.167982 ... 0.802642
readingscore 0.244313 ... 0.954598
writingscore 0.301225 ... 1.000000
[8 rows x 8 columns]
How can I get the all result data (the things that should be in the "..." ) in the results??
Python is showing only some of the data in the results..
Instead of showing
t_gender t_race t_parentallevelofeducation t_lunch t_testpreparationcourse mathscore readingscore writingscore
in the columns it only shows
t_gender ... writingscore
I want to display all columns
解决方案
Change the printing options:
import pandas as pd
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
推荐阅读
- regex - REGEXP_EXTRACT with URL in Hive
- ios - 切出切片做圆圈?iOS 斯威夫特 4
- excel-formula - 如何将2018年6月30日,小时14格式的excel数据转换为2018-04-02T00:00:00需要excel公式
- java - 如何检查 JSON 字段是否为空
- vba - 存在数据的动态邮件合并
- python - Pandas:使用 loc 获取固定数量的行
- python - 如何在 Tkinter 列表框中选择多行?
- c - 实现我自己的“字符串”工具——缺少 GNU 字符串发现的序列
- node.js - 使用 node.js 连接到 nem 测试节点时出错
- javascript - 将页面锚点传递到新页面而不使用 URL