python - Array element with a sequence -
want plot x_values_edited , speed. have error:
valueerror: setting array element sequence
plt.plot(x_values_edited, speed, '.' )
my code , inputs here:
x_values_edited:
[datetime.datetime(2015, 1, 1, 0, 0), datetime.datetime(2015, 1, 1, 0, 1), datetime.datetime(2015, 1, 1, 0, 2), datetime.datetime(2015, 1, 1, 0, 3), datetime.datetime(2015, 1, 1, 0, 4), datetime.datetime(2015, 1, 1, 0, 5), datetime.datetime(2015, 1, 1, 0, 6), datetime.datetime(2015, 1, 1, 0, 7), datetime.datetime(2015,
speed:
[[58.5, 97.0, 56.0, 87.5, 95.0, 100.0, 104.0, 98.5, 101.0, 98.5, 86.5, 90.0, 97.5, 16.5, 103.0, 98.0, 48.0, 98.5, 93.5, 99.0, 101.5, 86.5, 108.5, 22.0, 92.5, 84.5, 103.5, 86.5, 103.0, 96.5, 91.5, 101.5, 86.0], [99.5, 101.0, 96.5, 94.5, 92.0, 89.5, 83.0, 94.0, 97.5, 103.5, 93.5, 101.0, 95.5, 89.0, 102.5, 89.0, 104.5, 102.0, 107.0, 96.5, 97.5, 97.5, 93.0, 95.0, 88.5, 89.0, 101.0, 97.0, 98.5, ]]
here quick fix.
from matplotlib.pyplot import scatter, show, xlim, ylim
from matplotlib.pyplot import scatter, show, xlim, ylim index, item in enumerate(speed): scatter([times[index]]*len(item), item, marker='.') xlim(min(times), max(times)) ylim(min(min(speed)), max(max(speed))) show()
produces:
sorry took long. had in underground!
Comments
Post a Comment