[英]How do I reshape longitude data in an xarray of nc files
Assuming you have a column of longitude data (it's hard to tell from your sample), something like this should work:假设您有一列经度数据(很难从您的样本中看出),这样的事情应该可以工作:
pick = pd['longitude']>180
pd.loc[pick,'longitude'] = pd.loc[pick,'longitude'] - 360
The first line chooses the rows where longitude needs adjusting.第一行选择需要调整经度的行。 The second line does the math for only those rows.
第二行仅对这些行进行数学运算。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.