python - 使用 Python pandas 获取数据框的所有行

标签 python pandas dataframe

<分区>

我运行了一个 python 代码并得到了如下数据帧输出:

1    Department of Susta... (2)       Community Services (2)
2    Department of Commu... (2)       Community Services (2)
3    Sustainability Vict... (1)       Community Services (1)
4    Southern Grampians ... (1)       Community Services (1)
5    Productivity Commis... (1)       Community Services (1)
6         Parliament of NSW (1)       Community Services (1)
..                           ...                          ...
30      Noosa Shire Council (2)     Sport and Recreation (2)
31   State Library of Qu... (1)     Sport and Recreation (1)
32   Emergency Services ... (1)     Sport and Recreation (1)
33   Department of Susta... (1)     Sport and Recreation (1)

现在我没有第 7 到 29 行黑白。如何获取所有行?

最佳答案

这只是显示问题,我更喜欢:

#temporaly display 999 rows
with pd.option_context('display.max_rows', 999):
    print (df)

当您退出 with block 时,选项值会自动恢复。

关于python - 使用 Python pandas 获取数据框的所有行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44919307/

相关文章:

python - 如何按 Python (pandas) 中列中的出现次数对 Dataframe 进行排序

python - 当没有重复项时,pandas 中索引重复错误

python - 将 pandas 数据帧作为参数传递给 python subprocess.Popen

Python子进程: How can I execute a sub-process of a process in python?

python - 有人可以帮我理解这个简短的 .py

python - 如何在 python 中实现负无穷大?

python - 使用 Python : what exactly does the interpolation methods? 进行 cv2.resize

python - 对非时间数据进行上采样

Python Pandas 从 Dataframe 中获取单一值

python - 有什么原因导致 NaN 而不是生成的 str 吗?