LoginSignup
1
1

More than 1 year has passed since last update.

netcdfデータをxarray.Datasetとして読み,変数名のみリストで取り出す

Last updated at Posted at 2022-04-01
import xarray as xr
ds = xr.open_dataset('hoge.nc')
[k for k, v in ds.items()]

dsは辞書なので(!?),itemsメソッドによりkeys(k, 変数名)とvalues(v, データ)のタプルを返す.
そのkeysのみを受け取ってリストを作るリスト内包表記.

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1