Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8170031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:02:39+00:00 2026-06-06T21:02:39+00:00

I have the following output from Python: x1 = [[1, 1, 6, 12, 75,

  • 0

I have the following output from Python:

x1 = [[1, 1, 6, 12, 75, 75], [2, 2, 12, 36, 225, 300], [3, 3, 24, 84, 525, 825], [4, 4, 48, 180, 1125, 1950], [5, 5, 96, 372, 2325, 4275], [6, 6, 192, 756, 2835, 7110], [7, 7, 384, 1524, 5715, 12825], [8, 8, 768, 3060, 7650, 20475]]
x2 = [[1, 2, 6, 12, 75, 75], [2, 3, 12, 36, 225, 300], [3, 4, 24, 84, 525, 825], [4, 5, 48, 180, 1125, 1950], [5, 6, 96, 372, 2325, 4275], [6, 7, 192, 756, 2835, 7110]]
x3 = [[1, 3, 6, 12, 75, 75], [2, 4, 12, 36, 225, 300], [3, 5, 24, 84, 525, 825], [4, 6, 48, 180, 1125, 1950], [5, 7, 96, 372, 2325, 4275]]
x4 = [[1, 4, 6, 12, 75, 75], [2, 5, 12, 36, 225, 300], [3, 6, 24, 84, 525, 825], [4, 7, 48, 180, 1125, 1950]]

Basically I want to add these lists by matching up the second number in each (this second number represents a month, whereas the other numbers following it represent members or profit).

So if we look at lists x1 and x2, I would want to join x1[1] and x2[0] together because they both are equal at the second element (i.e. x1[1][1] and x2[0][1]).

By joining together I mean I would like to add them. Ideally I would prefer to only add the 3rd through 6 elements together.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:02:42+00:00Added an answer on June 6, 2026 at 9:02 pm

    You should check out using list comprehensions and slicing lists. That basically will let you turn:

    I would prefer to only add the 3rd through 6 elements together.

    into exactly what you want to do. To do the combining of lists, you might try creating a dict and them sum together at the end. I’m not 100% clear on what your expected output should be from that whole list and it’s somewhat dependent on other things going on in your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data structure (an atomic vector?) output from daply in plyr
I have the following python function that allows me to run shell commands from
I have the following code to return multiple values from pl/python: CREATE TYPE named_value
I have the following files dummy.py #!c:/Python27/python.exe -u from mako import exceptions from mako.template
I have the following output: Player name: RON_98 Player name: RON_97 player name: RON_96
I have the following output sing var_dump.. How do I read the value of
I have the following output (via link) which displays the var_dump of some XML
I have the following output: <section class=group> <div class=header>Header 1</div> <div class=item>item1</div> <div class=item>item2</div>
In my current repo I have the following output: $ git branch -a *
I have managed to bring the following output with this query SELECT DISTINCT IF(purchaseproduct_customerid=0,contactperson,vendorname)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.