Skip to content

merge two datasets gives unexpected dimensions #6158

Answered by keewis
shuai-zhou asked this question in Q&A
Discussion options

You must be logged in to vote

just a quick guess: maybe your coordinates are not exactly equal? In other words, I think this is a floating-point issue.

To check that, try ds_prcp.longitude.equals(ds_tmean.longitude), and you can also try comparing the output of ds_prcp.longitude.item(0) with ds_tmean.longitude.item(0).

If you are sure that the coordinates should be exactly equal, you can override the coordinates of one dataset, e.g.:

ds_tmean = ds_tmean.assign_coords(longitude=ds_prcp.longitude, latitude=ds_prcp.latitude)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dcherian
Comment options

@shuai-zhou
Comment options

Answer selected by shuai-zhou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants