Uh oh!
There was an error while loading. Please reload this page.
Support explicitly setting a dimension order with to_dataframe() - #4333
Conversation
max-sixty
commented
Aug 11, 2020
Great, thanks @Thomas-Z , LGTM Does anyone have thoughts on the kwarg name? |
dcherian
commented
Aug 11, 2020
How about |
Hello, I actually followed @shoyersuggestion to use to_dask_dataframe parameter name. And I just realized I only did half the work. I'll add this parameter to DataArray.to_dataframe if you validate this name. |
dcherian
commented
Aug 11, 2020
OK consistency with |
shoyer
commented
Aug 11, 2020
I like |
| if dim_order is None: | ||
| dim_order = list(self.dims) | ||
| elif set(dim_order) != set(self.dims): | ||
| raise ValueError( | ||
| "dim_order {} does not match the set of dimensions on this " | ||
| "Dataset: {}".format(dim_order, list(self.dims)) | ||
| ) |
There was a problem hiding this comment.
Maybe we could make a small helper method _normalize_dim_order() that we could use both here and in to_dask_dataframe?
Thomas-Z
commented
Aug 11, 2020
Do we want DataArray.to_dataframe to be consistent with Dataset.to_dataframe regarding the default dimension ordering (i.e. alphabetically) or do we want to keep the current behavior (DataArray.dims order)? |
shoyer
commented
Aug 11, 2020
|
Refactoring some code, fixing some docstring.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dcherian
commented
Aug 14, 2020
Thanks @Thomas-Z . I see this is your first PR here. Welcome to xarray! |
max-sixty
commented
Aug 14, 2020
Thanks @Thomas-Z ! Great to have you as a contributor |
Thomas-Z
commented
Aug 15, 2020
My pleasure. |
* upstream/master: (34 commits) Fix bug in computing means of cftime.datetime arrays (pydata#4344) fix some str accessor inconsistencies (pydata#4339) pin matplotlib in ci/requirements/doc.yml (pydata#4340) Clarify drop_vars return value. (pydata#4244) Support explicitly setting a dimension order with to_dataframe() (pydata#4333) Increase support window of all dependencies (pydata#4296) Implement interp for interpolating between chunks of data (dask) (pydata#4155) Add @mathause to current core developers. (pydata#4335) install sphinx-autosummary-accessors from conda-forge (pydata#4332) Use sphinx-accessors-autosummary (pydata#4323) ndrolling fixes (pydata#4329) DOC: fix typo argmin -> argmax in DataArray.argmax docstring (pydata#4327) pin sphinx to 3.1(pydata#4326) nd-rolling (pydata#4219) Implicit dask import 4164 (pydata#4318) allow customizing the inline repr of a duck array (pydata#4248) silence the known docs CI issues (pydata#4316) enh: fixedpydata#4302 (pydata#4315) Remove all unused and warn-raising methods from AbstractDataStore (pydata#4310) Fix map_blocks example (pydata#4305) ...
* upstream/master: (40 commits) Fix bug in computing means of cftime.datetime arrays (pydata#4344) fix some str accessor inconsistencies (pydata#4339) pin matplotlib in ci/requirements/doc.yml (pydata#4340) Clarify drop_vars return value. (pydata#4244) Support explicitly setting a dimension order with to_dataframe() (pydata#4333) Increase support window of all dependencies (pydata#4296) Implement interp for interpolating between chunks of data (dask) (pydata#4155) Add @mathause to current core developers. (pydata#4335) install sphinx-autosummary-accessors from conda-forge (pydata#4332) Use sphinx-accessors-autosummary (pydata#4323) ndrolling fixes (pydata#4329) DOC: fix typo argmin -> argmax in DataArray.argmax docstring (pydata#4327) pin sphinx to 3.1(pydata#4326) nd-rolling (pydata#4219) Implicit dask import 4164 (pydata#4318) allow customizing the inline repr of a duck array (pydata#4248) silence the known docs CI issues (pydata#4316) enh: fixedpydata#4302 (pydata#4315) Remove all unused and warn-raising methods from AbstractDataStore (pydata#4310) Fix map_blocks example (pydata#4305) ...
hammer
commented
Aug 19, 2020
Just noting for GitHub metadata purposes that this PR addresses the |
isort . && black . && mypy . && flake8whats-new.rst