python - 如何在 .txt 文件中使用 Pandas 的 Parallel_coordinates
问题描述
我正在尝试在 .txt 文件上使用 pandas 的 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)使用此代码,我得到 KeyError: "GTID" 即使 GTID 是我的 .txt 文件中包含该类的列的名称。(抱歉,我无法共享更多文件)。我的数据框已成功加载,我检查了正在使用的 df.head() .txt 文件
2)我只想绘制第 4、14、15 列:有没有办法做到这一点?
解决方案
推荐阅读
- spring-amqp - Spring AMQP XML 消息转换器
- python - 4d 数组上的 view_as_windows
- html - 图像防止弹性项目拉伸到屏幕底部
- botframework - 英雄卡中未显示粗体文字
- c++ - 如何根据传递给函数的变量定义特征矩阵大小
- python - Python:使用自动 Y 缩放绘制烛台
- javascript - 这个脚本地理定位重定向缺少什么
- azure - OneDrive 上传的 MS Graph API 权限
- c# - 在 Bot 框架中选择 promptdialog.choice 选项时显示描述而不是 id
- java - Java 和 SQL - XADataSource