from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import pylab as p
import mpl_toolkits.mplot3d.axes3d as p3
fname = "C:\Users\Desktop\Temperature.csv"
depth_list = 
tempr_list = 
with open(fname) as fin:
for ix, line in enumerate(fin):
line = line.rstrip()
line_list = line.split(';')
if ix == 0:
time_list = line_list[1:]
tempr_list.append([float(t) for t in line_list[1:]])
fig = plt.figure()
ax = fig.gca(projection='3d')
#ax.plot_trisurf(time_list, depth_list, tempr_list, cmap=cm.jet, linewidth=0.2)
timelist = 
for i in range(len(time_list)):
timelist = time.mktime(time.strptime(time_list[i], "%d.%m.%Y %H:%M:%S"))
ax.plot3D(depth_list, tempr_list, timelist)
The error I get, I'll just paste the entire thing:
ValueError: setting an array element with a sequence.
I tried converting the timelist to string, but its not working.. Not quite sure what to do:(
You'll have better luck posting on the matplotlib forums.
Something tells me that time_list[i] is not actually a single value, but is likely an interable (tuple or list).
I'd also recommend using pandas, importing the data into your dataframe, and using a TimeIndex as the label axis. If you're working with timeseries data, it will really give you a lot more power than just basic python.