Skip to main content
28 votes
6 answers
36k views

I have a xarray dataset with irregular spaced latitude and longitudes coordinates. My goal is to find the value of a variable at the point nearest a certain lat/lon. Since the x and y dimensions are ...
blaylockbk's user avatar
  • 3,561
28 votes
5 answers
17k views

Simple question: I don't only want the value of the maximum but also the coordinates of it in an xarray DataArray. How to do that? I can, of course, write my own simple reduce function, but I wonder ...
nandaloo's user avatar
  • 1,027
26 votes
2 answers
26k views

I've been using the .append() method to concatenate two tables (with the same fields) in pandas. Unfortunately this method does not exist in xarray, is there another way to do it?
Itay Lieder's user avatar
25 votes
3 answers
26k views

I would like to extract the values of the coordinate variables. For example I create a DataArray as: import xarray as xr import numpy as np import pandas as pd years_arr=range(1982,1986) time = pd....
Ray Bell's user avatar
  • 1,638
23 votes
2 answers
45k views

I am looking for a way of extracting a list of the data variable names (strings) from a xarray.DataSet object. I have used xr_object.data_vars and xr_object.data_vars.keys() but they don't seem to ...
Thomas's user avatar
  • 343
23 votes
5 answers
275k views

How can I solve this error After running my code as follows . I am using the function below and implementin running window for loop on it but end up getting the error below. The for loop works and ...
user11036847's user avatar
22 votes
1 answer
9k views

The pandas pivot tables documentation seems to recomend dealing with more than two dimensions of data by using multiindexing: In [1]: import pandas as pd In [2]: import numpy as np In [3]: import ...
kilojoules's user avatar
  • 10.3k
22 votes
1 answer
33k views

I want to replace values in a variable in an xarray dataset with None. I tried this approach but it did not work: da[da['var'] == -9999.]['var'] = None I get this error: *** TypeError: unhashable ...
user308827's user avatar
  • 22.5k
21 votes
1 answer
17k views

I have a folder with NetCDF files from 2006-2100, in ten year blocks (2011-2020, 2021-2030 etc). I want to create a new NetCDF file which contains all of these files joined together. So far I have ...
Pad's user avatar
  • 911
19 votes
3 answers
13k views

I have a very large netCDF file that I am reading using netCDF4 in python I cannot read this file all at once since its dimensions (1200 x 720 x 1440) are too big for the entire file to be in memory ...
user308827's user avatar
  • 22.5k
19 votes
5 answers
7k views

I have a 1D array of independent variable values (x_array) that match the timesteps in a 3D numpy array of spatial data with multiple time-steps (y_array). My actual data is much larger: 300+ ...
Robbi Bishop-Taylor's user avatar
19 votes
1 answer
22k views

I have a package that uses pandas Panels to generate MultiIndex pandas DataFrames. However, whenever I use pandas.Panel, I get the following DeprecationError: DeprecationWarning: Panel is ...
cge's user avatar
  • 10k
17 votes
4 answers
42k views

I have an xarray DataArray that looks like this below with shape (1,5,73,144,17) and I'm trying to drop or delete the "level" coordinates. So, ultimately, i need the variable to have shape = ...
user2100039's user avatar
  • 1,366
17 votes
3 answers
4k views

Is there a way to merge 2 or more netCDF files with the same time dimension but different spatial domains into a single netCDF file? The spatial domains are specified by latitude and longitude ...
user308827's user avatar
  • 22.5k
16 votes
3 answers
50k views

I am trying to convert a dataframe to xarray. The head is like this: z Class DA x y iline xline idz 2 ...
Y. Peng's user avatar
  • 364

15 30 50 per page
1
2 3 4 5
164