Home > Software engineering >  How to convert dtype of time axis from float32 to datetime64 for multiple files and then merge them
How to convert dtype of time axis from float32 to datetime64 for multiple files and then merge them

Time:02-10

I have separate monthly netcdf files from 1940-2021 and I want to merge them in one single file. But the issue is that the time axis has dtype = float32 and I wonder how to merge them. So I need to convert float32 to datetime64. Please tell me a proper way to handle this problem. And if there is any alternate ways then let me know.

This is a example for how my time axis look for the year 1940 first month:-

time (time) float32 1.94e 05

long_name : time: yyyymm

reference_time : 194001.0

standard_name : time

array([194001.], dtype=float32)

Thank you.

CodePudding user response:

  •  Tags:  
  • Related