【发布时间】:2017-12-07 14:55:43
【问题描述】:
我已经问过我的问题:How to read two columns using python,但我的目标是绘制一个图形oX = f(oY)。
我试过了:
import matplotlib.pyplot as plt
from matplotlib import style
import csv
with open('file.csv') as f:
reader = csv.reader(f)
for row in reader:
res = row[0].split()
oX = res[0]
oY = res[1]
print (oX , oY)
它对我不起作用。
【问题讨论】:
-
不起作用是什么意思?这种描述对我们没有帮助。
-
嗨 eyllanesc,我想将 oX 和 oY 转换为列表,以绘制图表
-
请参阅this question,了解如何将分类变量绘制为散点图。
标签: python csv matplotlib