セクション 3. 章 4
single
Challenge: Polars Data Aggregation
メニューを表示するにはスワイプしてください
In this challenge, you will use polars to efficiently perform data aggregation on large datasets. Specifically, you are tasked with grouping a large DataFrame by one column and computing the mean of another column for each group. This is a common operation in data analysis, especially when working with big data, as it allows you to summarize and extract insights from subsets of your data without loading everything into memory at once.
タスク
スワイプしてコーディングを開始
Write a function using polars that groups a DataFrame by a specified column and computes the mean of another column for each group.
- The function must take a
pl.DataFrame, agroup_colstring, and avalue_colstring as arguments. - The function must return a new DataFrame containing each unique value in
group_coland the mean ofvalue_colfor that group. - The resulting DataFrame must have a column named
"mean_"followed by thevalue_colname, containing the computed mean values.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 3. 章 4
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください