11# Writing Data
22
3- ``` {warning}
4-
5- This is a highly experimental feature, recently introduced and included for
6- evaluation by early users. At this time we do not recommend using it for
7- anything important.
8- ```
9-
103In this tutorial we will start Tiled in a mode where the client can
114write (upload) data for later retrieving, search, or sharing.
125
@@ -48,19 +41,19 @@ where `...` will be whatever secret was printed at server startup above.
4841
4942## Write data
5043
51- Write array and tabular data .
44+ Write array.
5245
5346``` python
54- # Write simple Python list (which gets converted to numpy.array).
55- >> > client.write_array([1 , 2 , 3 ], metadata = {" color" : " red" , " barcode" : 10 })
56- < ArrayClient shape= (3 ,) chunks= ((3 ,),) dtype= int64>
57-
5847# Write an array.
5948>> > import numpy
6049>> > client.write_array(numpy.array([4 , 5 , 6 ]), metadata = {" color" : " blue" , " barcode" : 11 })
6150< ArrayClient shape= (3 ,) chunks= ((3 ,),) dtype= int64>
6251
63- # Create an array and grow it by one
52+ # Write a Python list (which gets converted to numpy array).
53+ >> > client.write_array([1 , 2 , 3 ], metadata = {" color" : " red" , " barcode" : 10 })
54+ < ArrayClient shape= (3 ,) chunks= ((3 ,),) dtype= int64>
55+
56+ # Create an array and grow it by one.
6457>> > new_array = client.write_array([1 , 2 , 3 ])
6558>> > new_array
6659< ArrayClient shape= (3 ,) chunks= ((3 ,),) dtype= int64>
@@ -72,10 +65,14 @@ Write array and tabular data.
7265< ArrayClient shape= (4 ,) chunks= ((3 , 1 ),) dtype= int64>
7366>> > new_array.read()
7467array([1 , 2 , 3 , 4 ])
68+ ```
69+
70+ Write tabular data in a pandas DataFrame.
7571
76- # Write a table (DataFrame).
72+ ``` python
7773>> > import pandas
78- >> > client.write_dataframe(pandas.DataFrame({" x" : [1 , 2 , 3 ], " y" : [4 , 5 , 6 ]}), metadata = {" color" : " green" , " barcode" : 12 })
74+ >> > df = pandas.DataFrame({" x" : [1 , 2 , 3 ], " y" : [4 , 5 , 6 ]})
75+ >> > client.write_dataframe(df, metadata = {" color" : " green" , " barcode" : 12 })
7976< DataFrameClient [' x' , ' y' ]>
8077```
8178
0 commit comments