Clean payout amounts

MediumPayPalstr.replaceto_numericto_period· 20 XP

raw_payouts.csv came from an old system that stored amounts as text: some like "$1,372.51", some like " 526.13 " with spaces around them, and a few say pending or N/A because they haven't been paid yet.

Clean amount_text into numbers (pending and N/A become missing values and are left out of the totals), then store the total payout per month of paid_on (use .dt.to_period("M")), rounded to 2 decimals, as a Series.

Expected answer

Store your answer in result.

  • One value per month

Hints, the later steps and the answer come with Pro.

import pandas as pd

payouts = pd.read_csv("raw_payouts.csv")
result = ...