When I try to convert the pandas DataFrame to Xarray dataset I get this error:
ValueError: can only convert an array of size 1 to a Python scalar
Image:
Code:
# Convert the DataFrame back to xarray Dataset and assign CRS
temp_group_df.set_index(['lat', 'lon', 'month'], inplace=True)
temp_array = temp_group_df.to_xarray()
temp_array.rio.write_crs('epsg:4326', inplace=True)
display(temp_array)