• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: ValueError: condition must be a 1-d array

Resolved: ValueError: condition must be a 1-d array

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Hi I’ve been stuck on this error for a while now! I want to interpolate data 3 D and then display it in 2D (in Basemap). Unfortunately, I get this error when I want to plot the grid[long], grid[lat] and the interpolation values with contourf:
I already tried to import the values as y = df['variable'].values.tolist() but this did not change the error. Unfortunately, as I am new to arrays, I do not have a good understanding of them and need to solve this error in a timely manner.
The error Message:

Answer:

Hmm.. Seems to be a problem with np.compress
condition needs to be a 1-d array of bools according to: https://numpy.org/doc/stable/reference/generated/numpy.compress.html#numpy.compress This is what happens to grid[‘x’]
you can run this like
Cheers

If you have better answer, please add a comment about this, thank you!

matplotlib-basemap numpy python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Time Complexity: Find the number of people who know a secret leetcode 2327

24/03/2023

Resolved: Best way to create 3d matrix of variables in PULP

24/03/2023

Resolved: Openlayers: Update clusters depending on filter (geometryFunction)

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.