0

I have daily data from capital trades and I would like to resample and get the weekly value of buys and sells for each stock here is the data

I have tried

df = trades.set_index("Date")
# df.index = df.index - pd.tseries.frequencies.to_offset("7D")
df = df.resample("W").agg({"Value": sum}).reset_index()
df

and

df = trades.set_index("Date")
# df.index = df.index - pd.tseries.frequencies.to_offset("7D")
df = df.resample("W").agg({"Value": sum, 'Ticker': '-'.join}).reset_index()
df

but I cannot get the Ticker column correctly

  • 1
    need minimal and reproducible example code not image https://stackoverflow.com/help/minimal-reproducible-example – Panda Kim Dec 08 '22 at 13:33

0 Answers0