---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-28-d9712b317959> in <module>()
1 nc.to_netcdf('foo.nc', format='netcdf4',
----> 2 encoding={'stream1':{'complevel':4, 'chunksizes':{'index':10}}})
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\core\dataset.py in to_netcdf(self, path, mode, format, group, engine, encoding, unlimited_dims)
975 return to_netcdf(self, path, mode, format=format, group=group,
976 engine=engine, encoding=encoding,
--> 977 unlimited_dims=unlimited_dims)
978
979 def __unicode__(self):
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\backends\api.py in to_netcdf(dataset, path_or_file, mode, format, group, engine, writer, encoding, unlimited_dims)
571 try:
572 dataset.dump_to_store(store, sync=sync, encoding=encoding,
--> 573 unlimited_dims=unlimited_dims)
574 if path_or_file is None:
575 return target.getvalue()
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\core\dataset.py in dump_to_store(self, store, encoder, sync, encoding, unlimited_dims)
914
915 store.store(variables, attrs, check_encoding,
--> 916 unlimited_dims=unlimited_dims)
917 if sync:
918 store.sync()
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\backends\common.py in store(self, variables, attributes, *args, **kwargs)
244 cf_variables, cf_attrs = cf_encoder(variables, attributes)
245 AbstractWritableDataStore.store(self, cf_variables, cf_attrs,
--> 246 *args, **kwargs)
247
248
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\backends\common.py in store(self, variables, attributes, check_encoding_set, unlimited_dims)
213 self.set_attributes(attributes)
214 self.set_variables(variables, check_encoding_set,
--> 215 unlimited_dims=unlimited_dims)
216
217 def set_attributes(self, attributes):
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\backends\netCDF4_.py in set_variables(self, *args, **kwargs)
286 def set_variables(self, *args, **kwargs):
287 with self.ensure_open(autoclose=False):
--> 288 super(NetCDF4DataStore, self).set_variables(*args, **kwargs)
289
290 def prepare_variable(self, name, variable, check_encoding=False,
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\backends\common.py in set_variables(self, variables, check_encoding_set, unlimited_dims)
225 check = vn in check_encoding_set
226 target, source = self.prepare_variable(
--> 227 name, v, check, unlimited_dims=unlimited_dims)
228 self.writer.add(source, target)
229
~\AppData\Local\Continuum\Miniconda3\envs\obspy\lib\site-packages\xarray\backends\netCDF4_.py in prepare_variable(self, name, variable, check_encoding, unlimited_dims)
322 endian='native',
323 least_significant_digit=encoding.get('least_significant_digit'),
--> 324 fill_value=fill_value)
325 nc4_var.set_auto_maskandscale(False)
326
netCDF4\_netCDF4.pyx in netCDF4._netCDF4.Dataset.createVariable()
netCDF4\_netCDF4.pyx in netCDF4._netCDF4.Variable.__init__()
KeyError: 0