0

Edit: I think i've solved it, leaving it here incase anyone finds it helpful (or can improve what I have done) My solution was:

totalYield2017.loc['Q1'] = [fishLandingsQ1_df['Landed Weight (tonnes)'].sum(), fishLandingsQ1_df['Value(£)'].sum()]

I have created a blank dataframe

image 1

I want to populate it with sums of columns from other dataframes.

I have 4 other dataframes (one for each quarter, Q1, Q2 etc) that have columns for weight and value. I want to create a sum of each of those columns for the first row in my blank dataframe.

I have included a picture of one of the quarters dataframes, its the last 2 columns I want the sums of to be inputted into the blank dataframe

Image 2

2
  • 1
    You can post the solution as answer rather than at the top of question. Commented Jun 7, 2022 at 11:25
  • Ah, i'll do that, Thank you! Commented Jun 7, 2022 at 11:30

1 Answer 1

1

I think i've solved it, leaving it here in case anyone finds it helpful (or can improve what I have done) My solution was;

totalYield2017.loc['Q1'] = [fishLandingsQ1_df['Landed Weight (tonnes)'].sum(), fishLandingsQ1_df['Value(£)'].sum()]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.