0

I have a data frame that looks like this:

                        Nets  plot_height
2018-04-01 11:35:47  30000.6          250
2018-04-02 11:35:47  10000.5          250
2018-04-03 11:35:47  70000.5          250
2018-04-04 11:35:47   9000.8          250
2018-04-05 11:35:47  20000.5          250

I want to add another column "ratio" that is calculated by the df['Nets'].max divided by df['plot_height]

I tried

max_nets = df['Nets'].max
df['ratio'] = df['Nets'] / max_nets

that errors with: TypeError: unsupported operand type(s) for /: 'float' and 'method'

Timothy Lombard
  • 917
  • 1
  • 11
  • 31

0 Answers0