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 6999827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:35:31+00:00 2026-05-27T20:35:31+00:00

I have two lists that I am trying to compare with < or >

  • 0

I have two lists that I am trying to compare with < or > in python.

One (list1) is a slope and then a horizontal line (picture a obtuse angle of around 130 degrees) the second is a linear function with a negative slope that I calculated from the first list (list2). What I would like to do is compare the two lists list1 and list2 and create a new list3 where list3 = all the points in list1>list2. I am having trouble determining how to approach this. I have attempted list comprehension but I get the error

ValueError: The truth value of an array with more than one element is ambiguous.

v = [c for c in f if c > y]
list1= [0.0, 0.36, 0.34, 0.32, 0.32, 0.3, 0.3, 0.28, 0.28, 0.26, 0.26, 0.24, 0.24, 0.22, 0.22, 0.2, 0.2, 0.18, 0.18, 0.16, 0.16, 0.14, 0.14, 0.12, 0.12, 0.1, 0.1, 0.08, 0.08, 0.06, 0.06, 0.04, 0.04, 0.02, 0.02, 0.0,..., 0.0]
list2= [ 0.36  0.35  0.34 ..., -9.62 -9.63 -9.64]

Any help, advice, or guidance would be greatly appreciated. Also please let me know if my question is unclear in anyway.

  • 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-05-27T20:35:32+00:00Added an answer on May 27, 2026 at 8:35 pm

    If you mean that list3 is the collection of values from list1 where the corresponding value in list2 is smaller, then:

    list3 = [item1 for item1, item2 in zip(list1, list2) if item1 > item2]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Python, I have two lists that either have equal number of elements (e.g.
Suppose I have two lists that holds the list of source file names and
I have two lists and I want to select items that are not in
We have two lists: a=['1','2','3','4'] b=['2','3','4','5'] How to get a list with elements that
lest say I have two lists List1: Tom, Frank, Lacey List2: Frank, Tom what
I have two Lists of vector2: Position and Floor and I'm trying to do
I was trying to accomplish the following, if I have two lists, L1 and
i have two seperate lists list1 = [Infantry,Tanks,Jets] list2 = [ 10, 20, 30]
I have a list of objects that have two int properties. The list is
I have two threads, a producer thread that places objects into a generic List

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.