Skip to content

Commit 77d2340

Browse files
quant12345sedatguzelsemme
authored andcommitted
k_means_clust - change to remove warning (TheAlgorithms#10244)
* Replacing the generator with numpy vector operations from lu_decomposition. * Revert "Replacing the generator with numpy vector operations from lu_decomposition." This reverts commit ad217c6. * the change removes the warning: /home/runner/work/Python/Python/machine_learning/k_means_clust.py:236: FutureWarning: The provided callable <function sum at 0x7f20c02034c0> is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string "sum" instead. .agg( And /home/runner/work/Python/Python/machine_learning/k_means_clust.py:236: FutureWarning: The provided callable <function mean at 0x7f3d7db1c5e0> is currently using SeriesGroupBy.mean. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string "mean" instead. .agg(
1 parent f87eb49 commit 77d2340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

machine_learning/k_means_clust.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def report_generator(
235235
] # group by cluster number
236236
.agg(
237237
[
238-
("sum", np.sum),
238+
("sum", "sum"),
239239
("mean_with_zeros", lambda x: np.mean(np.nan_to_num(x))),
240240
("mean_without_zeros", lambda x: x.replace(0, np.NaN).mean()),
241241
(
@@ -248,7 +248,7 @@ def report_generator(
248248
)
249249
),
250250
),
251-
("mean_with_na", np.mean),
251+
("mean_with_na", "mean"),
252252
("min", lambda x: x.min()),
253253
("5%", lambda x: x.quantile(0.05)),
254254
("25%", lambda x: x.quantile(0.25)),

0 commit comments

Comments
 (0)