0

I have a dataframe which looks like this:

enter image description here

My end goal is to calculate the percent of each purpose and for each origin

enter image description here

So the final table should look this:

enter image description here

Any assistance or direction will be greatly appreciated

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Py_junior
  • 93
  • 1
  • 10

1 Answers1

0

Use this to drop the unwanted rows

i = df[(df.Origin == 'total origin')].index
df = df.drop(i)

And this to drop the Values column

df = df.drop(columns='Values')
Etch
  • 462
  • 3
  • 12