Jun-09-2019, 09:00 PM
I am now working with the same graph, but I would like to get the hours (every 3) between those dates,
but once I write this lines
but once I write this lines
time_list=[CEU_times[position1].hour() + datetime.timedelta(hours=i) for i in range(0,len(y),3)] plt.bar(np.arange(len(y[0:-1])),y[0:-1], width=1, color='blue' ) plt.xticks((range(len(y))),(time_list), rotation=90) gca().xaxis.tick_bottom() plt.show()I get the following error:
Error:runfile('C:/Users/Desktop/python ode/dtnew.py', wdir='C:/Users/Desktop/python ode')
Traceback (most recent call last):
File "<ipython-input-676-1b5fe841af55>", line 1, in <module>
runfile('C:/Users/Desktop/python ode/dtnew.py', wdir='C:/Users/Desktop/python ode')
File "C:\Users\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile
execfile(filename, namespace)
File "C:\Users\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/UsersDesktop/python ode/dtnew.py", line 73, in <module>
time_list=[CEU_times[position1].hour() + datetime.timedelta(hours=i) for i in range(0,len(y))]
File "C:/Users/Desktop/python ode/dtnew.py", line 73, in <listcomp>
time_list=[CEU_times[position1].hour() + datetime.timedelta(hours=i) for i in range(0,len(y))]
TypeError: 'int' object is not callable
any idea on why the error and how to fix it?