フリー問題

NVIDIA-Certified Associate: Accelerated Data Science のフリー問題 3 / 20 問目

問題文

A dataframe has a category column and a numeric amount column. Which pair of operations produces the total amount for each category?

選択肢

  1. Set the category column as the index and call the summary-statistics method, so the totals arrive as one of its rows.
  2. Sort the dataframe by the category column and then take a cumulative sum of the amount column, because sorting places identical categories next to each other and the running total then gives the per-category figure directly.
  3. Group the dataframe by the category column and then apply a sum aggregation to the amount column.
  4. Filter the dataframe once per category and sum each result, so the full table is scanned once for every category present.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。