如何在.txt文件中使用来自Pandas的Parallel_coordinates

时间:2019-06-12 15:53:42

标签: python pandas parallel-coordinates

我正在尝试在.txt文件中使用大熊猫的parallel_coordinates,但是有两个问题:

import pandas as pd
from pandas import read_fwf
from pandas.tools.plotting import parallel_coordinates
from matplotlib import pyplot as plt
df= pd.read_fwf(rPathtoFile)
parallel_coordinates(df, "GTID")
plt.show()

1)使用此代码,即使GTID是我的.txt文件中包含该类的列的名称,我也会得到KeyError:“ GTID”。(对不起,我无法共享更多文件)。我的数据框已成功加载,我通过df.head()进行了检查 .txt file being used

2)我只想绘制第4、14、15列:有办法吗?

0 个答案:

没有答案