-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
concat along dim with mix of scalar coordinate and array coordinates is not right #6434
Comments
The first example works because there's no index. In the second example, a The problem is when creating a array = da.isel(time=0).values
value = array.item()
seq = np.array([value], dtype=array.dtype)
pd.Index(seq, dtype=array.dtype)
# Float64Index([1.0], dtype='float64') So in the example above you end-up with different index types, which concat.indexes["time"]
# Index([1356998400000000000, 2013-01-01 06:00:00], dtype='object', name='time')
da.indexes["time"]
# DatetimeIndex(['2013-01-01 00:00:00', '2013-01-01 06:00:00'], dtype='datetime64[ns]', name='time', freq=None)
concat.indexes["time"].equals(da.indexes["time"])
# False I'm not very satisfied with the current solution in concat but I'm not sure what we should do here:
|
There's a typo in the first line, we need
The issue is that the Lines 130 to 133 in 3ead17e
Alternatively, we could loop over datasets and call Lines 470 to 472 in 305533d
|
Ah yes 👍 . Not sure why this case didn't fill the conditions for calling |
What happened?
Really hard to describe in words =)
fails when
concat
andda
should be identical. This is causing failures in cf-xarray:xarray-contrib/cf-xarray#319cc @benbovy
What did you expect to happen?
No response
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
No response
Environment
xarray main
The text was updated successfully, but these errors were encountered: