0

Trying to do Stock Options pivot table by Ticker Symbol. Current dataframe output:

enter image description here

Goal:

enter image description here

Got this far, but I am missing 1.A summed row by ticker symbol and 2. Sorting by value:

options_df_byTicker = pd.pivot_table(options_df,index=['Ticker','contractSymbol'],values=['dollarsTradedTodayApprox'],aggfunc=np.sum)

enter image description here

Pavel L
  • 39
  • 7
  • 1
    Hi Pavel, subtotal for pivot has been solved here: https://stackoverflow.com/questions/41383302/pivot-table-subtotals-in-pandas – Nike Mar 24 '21 at 21:33
  • 1
    pandas pivot table sort by values: https://stackoverflow.com/questions/41119623/pandas-pivot-table-sort-values-by-columns – Nike Mar 24 '21 at 21:34

0 Answers0