From 7a3d7a55f3846817dfc4f3dc0b0edf9cd5421340 Mon Sep 17 00:00:00 2001 From: Weijie Guo Date: Mon, 23 Oct 2023 14:44:49 +0800 Subject: [PATCH] use Series::clear --- crates/polars-core/src/chunked_array/random.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/polars-core/src/chunked_array/random.rs b/crates/polars-core/src/chunked_array/random.rs index 1238f8417db2f..0f51b5e44b3f9 100644 --- a/crates/polars-core/src/chunked_array/random.rs +++ b/crates/polars-core/src/chunked_array/random.rs @@ -245,7 +245,7 @@ impl DataFrame { let new_cols = self .columns .iter() - .map(|c| Series::new_empty(c.name(), c.dtype())) + .map(Series::clear) .collect_trusted(); Ok(DataFrame::new_no_checks(new_cols)) },