Every idea or suggestion would be appreciated! I have several "the same style" numpy objects(u1,u2,u3...) each of them is :
Object 1:
[[Timestamp('2004-02-28 00:59:16'), 19.9884],
[Timestamp('2004-02-28 01:03:16'), 19.3024],
...
[Timestamp('2004-02-28 01:06:16'), 19.1652]]
Object 2:
[[Timestamp('2004-02-28 01:08:17'), 19.567],
[Timestamp('2004-02-28 01:10:16'), 19.5376],
...
[Timestamp('2004-02-28 01:26:47'), 19.4788]]
I would like to find which of the these objects has the same "trends"in the time series by clustering them. I tried several ways including:
from sklearn.neighbors import NearestNeighbors
X = np.array([u1, u2, u3])
nbrs = NearestNeighbors(n_neighbors=2, algorithm='ball_tree').fit(X)
distances, indices = nbrs.kneighbors(X)
print(distances)
Some of my errors:
TypeError: float() argument must be a string or a number, not 'Timestamp'
ValueError: setting an array element with a sequence.
TypeError: only size-1 arrays can be converted to Python scalars
Conclusion
Can someone atleast give me a suggestion what should I do. Thanks!