1. Use the pandas library to control the display of the window:
import pandas as pd
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 100)
pd.set_option('display.width', 1000)
Set as above before outputting data,
'display.max_rows 'is to set the maximum number of rows displayed in the output window, and if it exceeds, the redundant data will be represented by an ellipsis;
'display.max_columns' is to set the maximum number of columns displayed in the output window, if it exceeds, the redundant columns will be represented by an ellipsis;
'display.width' It is to set the maximum width displayed in the output window. If the width of a row of data exceeds the set maximum width, the redundant column data will be displayed in a new line.
During the test, it was found that 'display.height' should not be set, and an error will be reported when setting this: "No such keys(s): 'display.height'", I think it should be
because the maximum height of the output window cannot be controlled , After all, when there is a lot of data, you can pull down to view it! (I don’t know if it’s correct or not. If it’s wrong, please correct me!)
—————————————————————
Original link: https://blog.csdn.net/AshleyXM/article/ details/104623300/
Second, use numpy's set_printoptions function
import numpy as np np.set_printoptions(threshold=np.inf) # np.inf means positive infinity# You can display the complete data
Three, Pycharm settings
pycharm output shows incomplete and ellipsis solutions
Incomplete data display
Solution: Open Help-Edit Custom Properties
Enter the following code:
idea.max.intellisense.filesize = 20000 idea.max.content.load.filesize = 20000 idea.cycle.buffer.size = 20000
Transferred from:
https://www.tqwba.com/x_d/jishu/357121.html