The dataset viewer is not available for this dataset.
Cannot get the config names for the dataset.
Error code:   ConfigNamesError
Exception:    BadZipFile
Message:      File is not a zip file
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 66, in compute_config_names_response
                  config_names = get_dataset_config_names(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 164, in get_dataset_config_names
                  dataset_module = dataset_module_factory(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1729, in dataset_module_factory
                  raise e1 from None
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1686, in dataset_module_factory
                  return HubDatasetModuleFactoryWithoutScript(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1071, in get_module
                  module_name, default_builder_kwargs = infer_module_for_data_files(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 593, in infer_module_for_data_files
                  split_modules = {
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 594, in <dictcomp>
                  split: infer_module_for_data_files_list(data_files_list, download_config=download_config)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 535, in infer_module_for_data_files_list
                  return infer_module_for_data_files_list_in_archives(data_files_list, download_config=download_config)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 563, in infer_module_for_data_files_list_in_archives
                  for f in xglob(extracted, recursive=True, download_config=download_config)[
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 1012, in xglob
                  fs, *_ = url_to_fs(urlpath, **storage_options)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/core.py", line 395, in url_to_fs
                  fs = filesystem(protocol, **inkwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 293, in filesystem
                  return cls(**storage_options)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 80, in __call__
                  obj = super().__call__(*args, **kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 62, in __init__
                  self.zip = zipfile.ZipFile(
                File "/usr/local/lib/python3.9/zipfile.py", line 1266, in __init__
                  self._RealGetContents()
                File "/usr/local/lib/python3.9/zipfile.py", line 1333, in _RealGetContents
                  raise BadZipFile("File is not a zip file")
              zipfile.BadZipFile: File is not a zip file

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

all_in_one.zarr.zip

<xarray.Dataset> Size: 25GB
Dimensions:      (Timestamp: 245376, station: 537)
Coordinates:

  • Timestamp (Timestamp) datetime64[ns] 2MB 2017-01-01 ... 2023-12-31T23:... address (station) <U187 402kB ... city (station) <U18 39kB ... latitude (station) float64 4kB ... longitude (station) float64 4kB ... state (station) <U17 37kB 'Chhattisgarh' ... 'West Bengal'
  • station (station) <U64 137kB '32Bungalows, Bhilai - CECB' ... 'Ward-... Data variables: (12/24) AT (Timestamp, station) float64 1GB ... BP (Timestamp, station) float64 1GB ... Benzene (Timestamp, station) float64 1GB ... CO (Timestamp, station) float64 1GB ... Eth-Benzene (Timestamp, station) float64 1GB ... MP-Xylene (Timestamp, station) float64 1GB ... ... ... TOT-RF (Timestamp, station) float64 1GB ... Toluene (Timestamp, station) float64 1GB ... VWS (Timestamp, station) float64 1GB ... WD (Timestamp, station) float64 1GB ... WS (Timestamp, station) float64 1GB ... Xylene (Timestamp, station) float64 1GB ...

Reading data

First install zarr and xarray libraries

pip install zarr xarray

Lazy load the dataset

import xarray as xr
ds = xr.open_zarr("zip:///::https://huggingface.co/datasets/Zeel/P1/resolve/main/all_in_one.zarr.zip")

Full dataset size is ~8 GB. ds variable contains the lazily loaded dataset, which means, it will only download a part of the data when a computation is needed on it. For example, If we need to calculate mean of PM2.5 in Delhi for 2022, it will only download PM2.5 data of all stations in Delhi for 2022.

delhi_2022_ds = ds.sel(station=ds.station.state=="Delhi", Timestamp="2022")["PM2.5"]
mean_val = delhi_2022_ds.mean().item()
print(mean_val)
# 99.5650831365871
Downloads last month
66