mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
k_means_clust - change to remove warning (#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 ad217c6616
.
* 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(
This commit is contained in:
parent
9a5a6c663c
commit
0070739233
@ -235,7 +235,7 @@ def report_generator(
|
||||
] # group by cluster number
|
||||
.agg(
|
||||
[
|
||||
("sum", np.sum),
|
||||
("sum", "sum"),
|
||||
("mean_with_zeros", lambda x: np.mean(np.nan_to_num(x))),
|
||||
("mean_without_zeros", lambda x: x.replace(0, np.NaN).mean()),
|
||||
(
|
||||
@ -248,7 +248,7 @@ def report_generator(
|
||||
)
|
||||
),
|
||||
),
|
||||
("mean_with_na", np.mean),
|
||||
("mean_with_na", "mean"),
|
||||
("min", lambda x: x.min()),
|
||||
("5%", lambda x: x.quantile(0.05)),
|
||||
("25%", lambda x: x.quantile(0.25)),
|
||||
|
Loading…
Reference in New Issue
Block a user