I am trying to read a csv file using pandas. The CSV file is structured as follows:
Timestamp, UTC, id, loc, spd
001, 12z, q20, "52, 13", 320
002, 13z, a32, "53, 12", 321
003, 14z, q32, "54, 11", 321
004, 15`, a43, "55, 10", 330
Then, I would like to plot the timestamp vs the spd using the following:
import pandas as pd
import matplotlib.pyplot as plt
fname = "data.csv"
data = pd.read_csv(fname,sep=",", header=None, skiprows=1)
data.columns = ["Timestamp", "UTC", "Callsign", "Position", "Speed", "Direction"]
t = data["Timestamp"]
utc = data["UTC"]
acid = data["Callsign"]
pos = data["Position"]
spd = ["Speed"]
plt.plot(t,spd)
plt.show()
I get a this error:
ValueError: x and y must have same first dimension, but have shapes (466,) and (1,).
When I try to plot the time vs utc it goes exactly as required. I suspect it has to do with the fact that the "loc" column has two values in one column, how would I solve this?
