Memory error after slicing xarray dataset x and y dimensions #6458
Unanswered
MorningGlory747
asked this question in
Q&A
Replies: 1 comment 4 replies
-
This means that it will load a 1x881x1201 into memory and then subset it. I would specify |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is your issue?
Hello,
Hope i'm doing this right.
I am opening 20 years of daily precipitation data from May to October on a 881x1201 grid. Each file contains one year of data.
The setup is the following
I need to compute various indices and I like looking at the values from the data to make sure that the code is working well.
To reduce the computational load during these verifications, I select only a specific x, y index, such as follows :
However, when comes the time where I want to run manipulations of numpy or panda (may that be from using
.to_numpy(), .to_dataframe(), .compute(), .load()
), the process will run very slowly and the following memory error will appear :But this doesn't make sense to me, why would xarray still think I have a 881,1201 dataset shape after I've selected specific indices (in this case,
x = 0 and y = 0
)?I feel like i'm not understanding something trivial about xarray and I'd greatly appreciate any help!
`INSTALLED VERSIONS
commit: None
python: 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: ('French_Canada', '1252')
libhdf5: 1.10.6
libnetcdf: 4.7.3
xarray: 0.19.0
pandas: 1.3.2
numpy: 1.20.3
scipy: 1.7.1
netCDF4: 1.5.5.1
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.3.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: 0.9.8.1
iris: None
bottleneck: 1.3.2
dask: 2021.08.1
distributed: None
matplotlib: 3.4.3
cartopy: 0.19.0.post1
seaborn: 0.11.2
numbagg: None
pint: 0.17
setuptools: 57.4.0
pip: 22.0.4
conda: None
pytest: None
IPython: 7.27.0
sphinx: None
`
Beta Was this translation helpful? Give feedback.
All reactions