diff --git a/docs/source/tutorials/writing.md b/docs/source/tutorials/writing.md index 479ba8196..4522d6709 100644 --- a/docs/source/tutorials/writing.md +++ b/docs/source/tutorials/writing.md @@ -60,6 +60,20 @@ Write array and tabular data. >>> client.write_array(numpy.array([4, 5, 6]), metadata={"color": "blue", "barcode": 11}) +# Create an array and grow it by one +>>> new_array = client.write_array([1, 2, 3]) +>>> new_array + + +# Extend the array. This array has only one dimension, here we extend by one +# along that dimension. +>>> new_array.patch([4], offset=(3,), extend=True) +>>> new_array + +>>> new_array.read() +array([1, 2, 3, 4]) +>>> + # Write a table (DataFrame). >>> import pandas >>> client.write_dataframe(pandas.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]}), metadata={"color": "green", "barcode": 12})