下面是我的python代码,用于在linux终端中显示xlsx文件的一部分:
import pandas as pd
2 require_cols=[1,3,6,7,8,9]
3 df=pd.read_excel('NGXP_6_2_2_dimensions.xlsx',sheet_name='3.1.1 AT&T NBE',usecols=require_cols,skiprows=63,skipfooter=94)
4 df.dropna(inplace=True)
5 #df=df.query("Type=='EXF-CTRL'")
6 #df1=df.head(-96)
7 print(df)
但是out出现时隐藏了一些部分:
Application Helm ... Unnamed: 9
0 Type ... RAM L
2 EXF-CTRL ... 4.4
6 EXF-CTRL ... 0.6
8 EXF-CTRL ... 2.2
10 EXF-CTRL ... 0.4
11 EXF-CTRL ... 8.8
12 EXF-CTRL ... 2.2
13 EXF-CTRL ... 4.4
14 EXF-CTRL ... 4.4
15 EXF-CTRL ... 8.8
16 EXF-CTRL ... 1.1
17 EXF-CTRL ... 8.8
20 EXF-CTRL ... 0.1
24 EXF-CTRL ... 2.2
26 EXF-CTRL ... 2.2
27 EXF-CTRL ... 8.8
28 EXF-CTRL ... 2.2
29 EXF-CTRL ... 4.4
30 EXF-CTRL ... 4.4
31 EXF-CTRL ... 2.2
32 EXF-CTRL ... 0.6
33 EXF-CTRL ... 8.8
34 EXF-CTRL ... 4.4
35 EXF-CTRL ... 2.2
36 EXF-CTRL ... 4.4
37 EXF-CTRL ... 17.6
38 EXF-CTRL ... 4.4
“...”部分是隐藏部分。我怎么能显示整个东西?
import pandas as pd
2 require_cols=[1,3,6,7,8,9]
3 df=pd.read_excel('NGXP_6_2_2_dimensions.xlsx',sheet_name='3.1.1 AT&T NBE',usecols=require_cols,skiprows=63,skipfooter=94)
4 df.dropna(inplace=True)
5 #df=df.query("Type=='EXF-CTRL'")
6 #df1=df.head(-96)
7 print(df)
但是out出现时隐藏了一些部分:
Application Helm ... Unnamed: 9
0 Type ... RAM L
2 EXF-CTRL ... 4.4
6 EXF-CTRL ... 0.6
8 EXF-CTRL ... 2.2
10 EXF-CTRL ... 0.4
11 EXF-CTRL ... 8.8
12 EXF-CTRL ... 2.2
13 EXF-CTRL ... 4.4
14 EXF-CTRL ... 4.4
15 EXF-CTRL ... 8.8
16 EXF-CTRL ... 1.1
17 EXF-CTRL ... 8.8
20 EXF-CTRL ... 0.1
24 EXF-CTRL ... 2.2
26 EXF-CTRL ... 2.2
27 EXF-CTRL ... 8.8
28 EXF-CTRL ... 2.2
29 EXF-CTRL ... 4.4
30 EXF-CTRL ... 4.4
31 EXF-CTRL ... 2.2
32 EXF-CTRL ... 0.6
33 EXF-CTRL ... 8.8
34 EXF-CTRL ... 4.4
35 EXF-CTRL ... 2.2
36 EXF-CTRL ... 4.4
37 EXF-CTRL ... 17.6
38 EXF-CTRL ... 4.4
“...”部分是隐藏部分。我怎么能显示整个东西?
1条答案
按热度按时间gdx19jrr1#
很可能你有很多列或者它们的名字太长,所以有些列被隐藏了。你可以使用print
(df.columns)
打印所有列的名字要显示所有行和列use:或者不选择所有列,例如: