Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

core.py AttributeError: 'float' object has no attribute 'copy' #1096

Unanswered
Discussion options

When using stumpy.ostinato on a list object Ts containing float values, I get an AttributeError. The issue is traced back to T = T.copy() in the _preprocess(T) function in core.py. I have tried preprocessing my list object containing multiple times series joined together as np.ndarray type before passing it through the ostinato function with no success. Using stumpy==1.11.1. Appreciate any suggestions, thanks!

You must be logged in to vote

Replies: 3 comments

Comment options

@PatrickKudo Thank you for your question and welcome to the STUMPY community. Can you please provide a simple, reproducible code example that demonstrates your error?

Your data should look like this:

import stumpy
import numpy as np
stumpy.ostinato(
 [np.array([584., -11., 23., 79., 1001., 0., 19.]),
 np.array([600., -10., 23., 17.]),
 np.array([ 1., 9., 6., 0.])],
 m=3)

even this works:

stumpy.ostinato(
 [[584., -11., 23., 79., 1001., 0., 19.],
 [600., -10., 23., 17.],
 [ 1., 9., 6., 0.]],
 m=3)

Using stumpy==1.11.1

Are you able to update to the latest version of STUMPY?

You must be logged in to vote
0 replies
Comment options

I think perhaps I am misunderstanding the expected input to ostinato. Is it expecting a list of separate time series like:

Ts = [np.array([0.111, 0.22, 0.33, 0]), np.array([0.4, 0.55, 0.66, 0]), np.array([0.7, 0.888, 0.99, 0])]

Not a list of separate time series joined into one time series as a list? I.e.:

Ts = [0.111, 0.22, 0.33, 0, 0.4, 0.55, 0.66, 0, 0.7, 0.888, 0.99, 0]

If it is not the latter, then I am using it wrong. I was trying to do:

radius, Ts_idx, subseq_idx = stumpy.ostinato([0.111, 0.22, 0.33, 0, 0.4, 0.55, 0.66, 0, 0.7, 0.888, 0.99, 0], 3)
You must be logged in to vote
0 replies
Comment options

I think perhaps I am misunderstanding the expected input to ostinato. Is it expecting a list of separate time series like:

Yes, that is correct!

Not a list of separate time series joined into one time series as a list? I.e.:

Yes, exactly! It's either a list of lists or a list of numpy arrays as shown above.

Please note that at the bottom of each API function (example), there is usually an "Examples" section that provides a clear working code example that might help

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #1095 on August 27, 2025 10:45.

AltStyle によって変換されたページ (->オリジナル) /