Skip to content

Navigation Menu

Sign in
Sign up

Scalar timeseries dimension #156

Answered by jeandet
Beforerr asked this question in Q&A
Discussion options

  • Speasy version: 1.4

Description

The scalar timeseries data should only have one dimension. But ndim is 2. I am not sure if this is a bug or feature.

What I Did

products = "cda/THB_L2_MOM/thb_peim_densityQ"
timerage = ["2016-05-20T17:47:00", "2016-05-20T17:53:40"]
d = spz.get_data(products, timerage)
d.ndim == 2
You must be logged in to vote

I would say:

def is_scalar(v):
 return len(v.shape)==2 and v.shape[1]==1

Replies: 3 comments

Comment options

@Beforerr, yes this was a design choice I made at the beginning to be consistent with what Pandas does.

You must be logged in to vote
0 replies
Comment options

Thanks for explanation. Then is there any reliable way to tell one time series is of scalar type?
...
On Sun, Aug 18, 2024 at 2:59 PM Alexis Jeandet ***@***.***> wrote: @Beforerr <https://github.com/Beforerr>, yes this was a design choice I made at the beginning to be consistent with what Pandas does. — Reply to this email directly, view it on GitHub <#149 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AOAN2QPWYFTZMK6VH7EGGRLZSEDJJAVCNFSM6AAAAABMWAQ3SWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGM4DOOJVGM> . You are receiving this because you were mentioned.Message ID: ***@***.***>
You must be logged in to vote
0 replies
Comment options

I would say:

def is_scalar(v):
 return len(v.shape)==2 and v.shape[1]==1
You must be logged in to vote
0 replies
Answer selected by jeandet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #149 on October 23, 2024 15:48.

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