Horje
xarray add coordinate Code Example
xarray add coordinate
>>> da = xr.DataArray(
...     np.random.rand(4),
...     coords=[np.array([358, 359, 0, 1])],
...     dims="lon",
... )
>>> da
<xarray.DataArray (lon: 4)>
array([0.5488135 , 0.71518937, 0.60276338, 0.54488318])
Coordinates:
  * lon      (lon) int64 358 359 0 1
  
>>> da.assign_coords(lon=(((da.lon + 180) % 360) - 180))
<xarray.DataArray (lon: 4)>
array([0.5488135 , 0.71518937, 0.60276338, 0.54488318])
Coordinates:
  * lon      (lon) int64 -2 -1 0 1




Python

Related
view whole dataset in python Code Example view whole dataset in python Code Example
image capture from camera python Code Example image capture from camera python Code Example
how to get a list of all values in a column df Code Example how to get a list of all values in a column df Code Example
?: (corsheaders.E013) Origin '.' in CORS_ORIGIN_WHITELIST is missing scheme or netloc HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com). Code Example ?: (corsheaders.E013) Origin '.' in CORS_ORIGIN_WHITELIST is missing scheme or netloc HINT: Add a scheme (e.g. https://) or netloc (e.g. example.com). Code Example
python pie chart with legend Code Example python pie chart with legend Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8