We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7e085f commit 2385c2cCopy full SHA for 2385c2c
datastream/tools/split_dataframes.py
@@ -144,12 +144,8 @@ def unassigned(keys, split):
144
145
def n_target_split(keys, proportion):
146
float_target_split = len(keys) * proportion
147
-
148
probability = float_target_split - int(float_target_split)
149
- if probability >= 1e-6 and np.random.rand() <= probability:
150
- return int(float_target_split) + 1
151
- else:
152
- return int(float_target_split)
+ return int(float_target_split) + int(np.random.rand() <= probability)
153
154
155
def selected(k, unassigned):
0 commit comments