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

Problems with NP Arrays #221

Answered by damanti-me
damanti-me asked this question in Q&A
Discussion options

Hi there!
Recently i wanted to create pngs with pyscript to be able to display them on an epaper display. This requires data from the HA, which I store in an np.array. this is where the error occurs during processing:
new_array=time_array>time_treshold
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

This does not occur when I run python locally. Pyscript is somehow unable to handle the datatype correcly.
new_array should be an logic array. The input time_array contains a list of 2021年06月26日T14:52:07.487Z as dates
time_threshold contains : datetime.datetime(2021, 6, 27, 11, 22, 49, 382875, tzinfo=<DstTzInfo 'Europe/Berlin' CEST+2:00:00 DST>)

probably this could have something to do with different versions of python...

You must be logged in to vote

works with another library

Replies: 1 comment

Comment options

works with another library

You must be logged in to vote
0 replies
Answer selected by damanti-me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

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