@@ -20,7 +20,7 @@ large-scale data.
20
20
Installation
21
21
------------
22
22
23
- Zarr requires Python 3.10 or higher. You can install it via `pip `:
23
+ Zarr requires Python 3.11 or higher. You can install it via `pip `:
24
24
25
25
.. code-block :: bash
26
26
@@ -43,7 +43,7 @@ To get started, you can create a simple Zarr array:
43
43
import numpy as np
44
44
45
45
# Create a 2D Zarr array
46
- z = zarr.zeros (
46
+ z = zarr.create_array (
47
47
store = " data/example-1.zarr" ,
48
48
shape = (100 , 100 ),
49
49
chunks = (10 , 10 ),
@@ -65,14 +65,11 @@ Zarr supports data compression and filters. For example, to use Blosc compressio
65
65
66
66
.. ipython :: python
67
67
68
- from numcodecs import Blosc
69
-
70
- z = zarr.open(
68
+ z = zarr.create_array(
71
69
" data/example-3.zarr" ,
72
70
mode = " w" , shape = (100 , 100 ),
73
71
chunks = (10 , 10 ), dtype = " f4" ,
74
- compressor = Blosc(cname = " zstd" , clevel = 3 , shuffle = Blosc.SHUFFLE ),
75
- zarr_format = 2
72
+ compressor = zarr.codecs.BloscCodec(cname = " zstd" , clevel = 3 , shuffle = zarr.codecs.BloscShuffle.SHUFFLE )
76
73
)
77
74
z[:, :] = np.random.random((100 , 100 ))
78
75
@@ -116,7 +113,7 @@ including the :class:`zarr.storage.ZipStore` and :class:`zarr.storage.FsspecStor
116
113
# Store the array in a ZIP file
117
114
store = zarr.storage.ZipStore(" data/example-3.zip" , mode = ' w' )
118
115
119
- z = zarr.open (
116
+ z = zarr.create_array (
120
117
store = store,
121
118
mode = " w" ,
122
119
shape = (100 , 100 ),
@@ -137,7 +134,7 @@ To open an existing array:
137
134
# Open the ZipStore in read-only mode
138
135
store = zarr.storage.ZipStore(" data/example-3.zip" , read_only = True )
139
136
140
- z = zarr.open (store, mode = ' r' )
137
+ z = zarr.open_array (store, mode = ' r' )
141
138
142
139
# read the data as a NumPy Array
143
140
z[:]
@@ -156,7 +153,7 @@ For example, to use S3:
156
153
157
154
import s3fs
158
155
159
- z = zarr.open (" s3://example-bucket/foo" , mode = " w" , shape = (100 , 100 ), chunks = (10 , 10 ))
156
+ z = zarr.create_array (" s3://example-bucket/foo" , mode = " w" , shape = (100 , 100 ), chunks = (10 , 10 ))
160
157
z[:, :] = np.random.random((100 , 100 ))
161
158
162
159
Read more about Zarr's :ref: `tutorial_storage ` options in the User Guide.
0 commit comments