Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 绘制每行的数据帧_Python_Pandas_Matplotlib - Fatal编程技术网

Python 绘制每行的数据帧

Python 绘制每行的数据帧,python,pandas,matplotlib,Python,Pandas,Matplotlib,我需要一个绘图,它为所有列上的每一行收集一个单线图,除了第一列显示为图例以标识每个线图。这是我写的for循环 for i in range(0,5): plt.plot(df.iloc[i, 1:], label=df.iloc[i,0]) plt.legend() 但是,这样y轴就乱了您的数据字符串有值吗?没有,它们是浮动的。顺便说一句,您可以执行df.set\u index(df.columns[0]).T.plot()

我需要一个绘图,它为所有列上的每一行收集一个单线图,除了第一列显示为图例以标识每个线图。这是我写的for循环

for i in range(0,5):
    plt.plot(df.iloc[i, 1:], label=df.iloc[i,0])
    plt.legend()

但是,这样y轴就乱了

您的数据字符串有值吗?没有,它们是浮动的。顺便说一句,您可以执行
df.set\u index(df.columns[0]).T.plot()