@@ -52,32 +52,30 @@ a more extensive list on API and usage.
52
52
.multi_sample
53
53
.sample_proportion
54
54
55
- Dataset from subscriptable
56
- --------------------------
55
+ Construct informative batches
56
+ -----------------------------
57
57
58
- .. code-block :: python
58
+ >>> datastream = Datastream.merge([
59
+ ... (apple_datastream, 2 ),
60
+ ... (pear_datastream, 1 ),
61
+ ... (banana_datastream, 1 ),
62
+ ... ])
63
+ ... next (iter (datastream.data_loader(batch_size = 6 )))
64
+ ['apple', 'apple', 'pear', 'banana', 'apple', 'apple']
59
65
60
- from datastream import Dataset
61
66
62
- fruits_and_cost = (
63
- (' apple' , 5 ),
64
- (' pear' , 7 ),
65
- (' banana' , 14 ),
66
- (' kiwi' , 100 ),
67
- )
67
+ Zip independently sampled datastreams
68
+ -------------------------------------
68
69
69
- dataset = (
70
- Dataset.from_subscriptable(fruits_and_cost)
71
- .map(lambda fruit , cost : (
72
- fruit,
73
- cost * 2 ,
74
- ))
75
- )
70
+ .. code-block :: python
76
71
77
- print (dataset[2 ]) # ('banana', 28)
72
+ datastream = Datastream.zip([
73
+ apple_datastream,
74
+ Datastream.merge([pear_datastream, banana_datastream])
75
+ ])
78
76
79
- Dataset from pandas dataframe
80
- -----------------------------
77
+ Pipeline functions
78
+ ------------------
81
79
82
80
.. code-block :: python
83
81
0 commit comments