I want to exact the value of a column in pandas and plot them, I coded like that:
traffic = pd.read_csv('traffic.csv')
traffic.columns = ['X', 'Y', 'Zone', 'Potential']
X = traffic.iloc[0:579, 0:1]['X']
Y = traffic.iloc[0:579, 1:2]['Y']
Z = traffic.iloc[0:579, 3:4]['Potential']
fig = plt.figure()
for x, y, z in zip(list(X), list(Y), list(Z)):
plt.plot(x, y, 'ro', markersize = Z, alpha = 0.5)
plt.show()
And got a TypeError: cannot convert the series to <class 'float'>. Now it seems it gives me a data with tails or something (if I print() them in the bottom there'll be some Name: X, dtype:float64), so failed the for loop.
So how can I get the value of a column?
The data is like that(copied from the .csv file):
413 359 A 1.7
403 343 A 2.1
383.5 351 A 2.2
381 377.5 A 1.7
339 376 A 2.1
335 383 A 2.5
317 362 A 2.4
334.5 353.5 A 2.4
333 342 A 2.1
282 325 A 1.6
...