I have a python zip with 2 arrays
zipped = zip(array1[], array2[])
Where array1 is of type numpy.datetime64[] adn array2 is a temperature
I want to make a time window in 1st array so i can have fixed array len (because i have other zipped arrays but they differ in array length)
this is what i have:
start = np.datetime64('2016-06-17T15:00')
stop = np.datetime64('2016-06-19T15:00')
index, temp = sensor_cal.get_arrays('ParsedData/parsed.csv')
print(index)
print(temp)
index2 = index[start:stop] /////////////This doesn't work
print(index2)
How can i define a time window like this.... My objective is to get same length arrays in the same time window (because they were previously frequency normalized) and then make a graph where xAxis is time and the various series correspond to the multiple temperature sensor arrays
My error:
['2016-06-17T13:23:59.000000000' '2016-06-17T13:24:59.000000000' '2016-06-17T13:25:59.000000000' ..., '2016-06-20T09:55:59.000000000' '2016-06-20T09:56:59.000000000' '2016-06-20T09:57:59.000000000'] [[
nan] [ nan] [ nan] ..., [ 25.54 ] [ 25.56333333] [ 25.59333333]] Traceback (most recent call last): File "main_cal.py", line 10, in index[start:stop] IndexError: failed to coerce slice entry of type numpy.datetime64 to integer
index[start:stop],startandstopmust be integers, indexes to positions in the array, e.g.index[2:5]. They are not values. You may need to review what indexing and slicing does innumpy(or for that matter Python lists).