ds.to_dict with data as arrays, not lists#7739
Conversation
|
I would appreciate any edification on the Mypy failures. Looking at the indicated lines, i'm 🤷 . |
|
I solved the mypy errors in a highly dubious way. 👀 |
|
In the off-hand chance this is reviewed before I push again, do not merge. I have a fix to encodings not getting properly roundtripped in Ds.from_dict(ds.to_dict). it was minor to fix but making sure it's tested will take a min |
|
@dcherian thanks! I didnt incoroprate any suggestions yet. |
|
i kinda implied, but I'll just state that the extra code to test equality of encodings is not handsome. |
|
I'm happy to "fix" the mypy issues, but it's on that I suspect might be requested for changes (if I recall correctly, it's just in the tests) |
|
Copying my comment from #1599 (comment)
|
ds.to_dict with data as arrays, not lists
headtr1ck
left a comment
There was a problem hiding this comment.
Looks good already.
Just a couple of minor comments.
And a design question/suggestion: what about instead of adding another kwarg, you could use data = True / False / "numpy"?
|
Making all the requested changes, the above should resolve momentarily. I like this "trick"/suggestion: I will implement this if we are in agreement with @dcherian |
Oh yeah, I like this. Only suggestion is |
…of Python datatypes, "array" returns numpy.ndarrays, False returns only the schema
|
I followed |
|
Thanks @jmccreight great work! |
* main: Introduce Grouper objects internally (pydata#7561) [skip-ci] Add cftime groupby, resample benchmarks (pydata#7795) Fix groupby binary ops when grouped array is subset relative to other (pydata#7798) adjust the deprecation policy for python (pydata#7793) [pre-commit.ci] pre-commit autoupdate (pydata#7803) Allow the label run-upstream to run upstream CI (pydata#7787) Update asv links in contributing guide (pydata#7801) Implement DataArray.to_dask_dataframe() (pydata#7635) `ds.to_dict` with data as arrays, not lists (pydata#7739) Add lshift and rshift operators (pydata#7741) Use canonical name for set_horizonalalignment over alias set_ha (pydata#7786) Remove pandas<2 pin (pydata#7785) [pre-commit.ci] pre-commit autoupdate (pydata#7783)
whats-new.rstapi.rst