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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:04:03+00:00 2026-05-28T20:04:03+00:00

I am performing some data validation and cleanup using Python, and I have run

  • 0

I am performing some data validation and cleanup using Python, and I have run into a logical error in some boolean comparisons that I am performing. I have a lookup table that needs to be cleaned up, so I am comparing range values to confirm that there is no overlap between sets of values. All list values have been fed in from a CSV file.

The code:

print >>f2, "Filter logic II for " + myKey[0] + " " + myKey[1] + " "  + myKey[2] + ":"
print >>f2, "outerRow[3] " + outerRow[3] + " >= innerRow[3] " + innerRow[3] + " and outerRow[3] " + outerRow[3] + " <= innerRow[4]" + innerRow[4] + " OR outerRow[4] " + outerRow[4] + " >= innerRow[3] " + innerRow[3] + " and outerRow[4] " + outerRow[4] + " <= innerRow[4]" + innerRow[4]
if ((outerRow[3] >= innerRow[3]) and (outerRow[3] <= innerRow[4])) or ((outerRow[4] >= innerRow[3]) and (outerRow[4] <= innerRow[4])):
    Test2 = True
    print >>f2, "Filter logic II = True"
else:
    Test1 = False
    print >>f2, "Filter logic II = False"

Which yields results after the first run:

*Filter logic II for XYZ KEY123 PRE:  
outerRow[3] 0 >= innerRow[3] 80 and outerRow[3] 0 <= innerRow[4]100 OR outerRow[4] 79 >= innerRow[3] 80 and outerRow[4] 79 <= innerRow[4]100  
Filter logic II = False*

But this (unexpected) result after the second run:

*Filter logic II for 080570BD 1998 VA PRE:  
outerRow[3] 80 >= innerRow[3] 0 and outerRow[3] 80 <= innerRow[4]79 OR outerRow[4] 100 >= innerRow[3] 0 and outerRow[4] 100 <= innerRow[4]79  
Filter logic II = True*

Where am I going wrong in the logical comparison? I’ve stared a this a bit too long, figured I see if I could get an assist from the world wide network.

  • 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-28T20:04:04+00:00Added an answer on May 28, 2026 at 8:04 pm

    Try to convert the data into an int. This is from an interactive Python shell:

    >>> "100" <= "79"
    True
    >>> 100 <= 79
    False
    >>> int("100") <= int("79")
    False
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service that is performing some updates across a couple of
I have a stored procedure that is performing some ddl dml operations. It retrieves
I have a web-site that generates some simple tabular data as html tables, many
I have an application that loads lots of data into memory (this is because
A while back when I was performing some bulk inserts of data into my
While performing some upcoming maintenance, I'm going to have to redirect all site traffic
I'm performing some parameter validation in a method and throwing an exception where necessary.
I have created an Attribute, call MyAttribute, which is performing some security and for
I have an event which needs to contact some third party providers before performing
I am getting the following error from some users while performing a lightweight Core

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.