Trigger loading data into memory and return this variable. Data will be computed and/or loaded from disk or a remote source. Unlike ``.compute``, the original variable is modified and returned. Normally, it should not be necessary to call this method in user code,
(self, **kwargs)
| 991 | return type(self)(dims, data, attrs, encoding, fastpath=True) |
| 992 | |
| 993 | def load(self, **kwargs) -> Self: |
| 994 | """Trigger loading data into memory and return this variable. |
| 995 | |
| 996 | Data will be computed and/or loaded from disk or a remote source. |
| 997 | |
| 998 | Unlike ``.compute``, the original variable is modified and returned. |
| 999 | |
| 1000 | Normally, it should not be necessary to call this method in user code, |
| 1001 | because all xarray functions should either work on deferred data or |
| 1002 | load data automatically. |
| 1003 | |
| 1004 | Parameters |
| 1005 | ---------- |
| 1006 | **kwargs : dict |
| 1007 | Additional keyword arguments passed on to ``dask.array.compute``. |
| 1008 | |
| 1009 | Returns |
| 1010 | ------- |
| 1011 | object : Variable |
| 1012 | Same object but with lazy data as an in-memory array. |
| 1013 | |
| 1014 | See Also |
| 1015 | -------- |
| 1016 | dask.array.compute |
| 1017 | Variable.compute |
| 1018 | Variable.load_async |
| 1019 | DataArray.load |
| 1020 | Dataset.load |
| 1021 | """ |
| 1022 | self._data = to_duck_array(self._data, **kwargs) |
| 1023 | return self |
| 1024 | |
| 1025 | async def load_async(self, **kwargs) -> Self: |
| 1026 | """Trigger and await asynchronous loading of data into memory and return this variable. |