我有一个csv文件,格式如下
x1,y1,x2,y2,x3,y3
1,1,2,2,6.5,7.5
2,2,-1,-1,,
,,-2,-3,,
,,-5,-5,,
例如,我想绘制(x1,y1)
、(x2,y2)
和(x3,y3)
列
rd1 = some_csv_reader('filename.csv')
matplotlib.pyplot.plot(rd1[:,0],rd1[:,1],rd1[:,2],rd1[:,3])
我尝试使用pandas.read_csv()
,但它将nan
作为空条目pandas.fwf()
不分隔列。我想在读取数组本身时排除数组中的任何空位置,而不是使用类似https://stackoverflow.com/a/11453235/11638153的东西。我该怎么做
list
个tuples
[Index(['x1', 'y1'], dtype='object'), Index(['x2', 'y2'], dtype='object'), Index(['x3', 'y3'], dtype='object')]
作为直线图
将每组
x
和y
组合成一个组相关问题 更多 >
编程相关推荐