-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
TST: add test for converting 0-len Series #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
These definitely should work. @MaximilianR did your fix handle Series -> DataArray? Let's leave this open if not... |
@shoyer Was that ever a problem? In [36]: xray.DataArray(pd.Series())
Out[36]:
<xray.DataArray (dim_0: 0)>
array([], dtype=float64)
Coordinates:
* dim_0 (dim_0) object
In [37]: xray.DataArray(pd.Series(range(20)))
Out[37]:
<xray.DataArray (dim_0: 20)>
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19])
Coordinates:
* dim_0 (dim_0) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
@jreback's first case uses the from_series constructor. |
Ah yes, that goes through the same path as the empty DataFrame. Alas I didn't add a test, but it works |
TBC, this does work, even if it's not tested: In [11]: xr.DataArray.from_series(pd.Series())
Out[11]:
<xarray.DataArray (index: 0)>
array([], dtype=float64)
Coordinates:
* index (index) object |
@MaximilianR Just updated the title of this issue to match |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity |
are these supported?
The text was updated successfully, but these errors were encountered: