pop删除list某一项
coords = [
xr.IndexVariable('lat_index', np.arange(scale_factor)),
xr.IndexVariable('lon_index', np.arange(scale_factor)),
xr.IndexVariable(
'var', self.var[self._vardim]) if self._vardim is not None else 0,
xr.IndexVariable('lat',
np.linspace(90 - 180 / (nlat_new) / 2, -90 + 180 / (nlat_new) / 2, nlat_new)),
xr.IndexVariable('lon',
np.linspace(-180 + (360 / nlon_new / 2), 180 - (360 / nlon_new / 2), nlon_new))
coords.pop(2)
# 删除第二项 ]
参考
- https://www.runoob.com/python/att-list-pop.html