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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:34:52+00:00 2026-06-07T15:34:52+00:00

Currently, I am attempting to retrieve numeric data from different CSV files. I then

  • 0

Currently, I am attempting to retrieve numeric data from different CSV files. I then place that data in lists in Python. However, I’m struggling to get Python to determine if there is a value in each separate list of data that is greater than a certain number. I need to be able to search each list separately for some value at which point Python should return some text of my choice. I’m not sure what I’m missing, but Python doesn’t seem to be handling my syntax as I was hoping.

    import csv
    stocks = ['JPM','PG','KO','GOOG']
    for stock in stocks:
        Data = open("%sMin.csv" % (stock), 'r')
        Ticker = []
        for row in Data:
            Ticker.append(row.strip().split(','))
        if Ticker > 735:
            print "%s Minimum" % (stock)

I modified the code the other stock became Ticker to remove the confusion.

  • 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-07T15:34:54+00:00Added an answer on June 7, 2026 at 3:34 pm

    There are three things wrong, preventing you from getting the result.

    1. stock is a list of values, so you aren’t able to directly do a numeric comparison to the list itself.
    2. You are appending lists to the list. So even if you were operating on each value you will be comparing a list to an int. Either figure out which element to append, or add them all appropriately.
    3. Find the max value in that list to compare to you int.

    First, append floats to your list:

    float(stock_value)
    

    Second, figure out which index of your split row is the numeric value. If they are all numeric values, then add them all to the list by extending:

    # only convert items to float that are not empty strings
    stock.extend(float(val) for val in row.strip().split(',') if val.strip())
    

    If its say, the first column, add just that one:

    stock.append(float(row.strip().split(',')[0]))
    

    Third, if you simply want to know if a value greater than 735 is in your list, you can simply ask it for the max value of the list:

    if max(stock) > 735:
        print "%s Minimum" % (stock)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently attempting to implement a custom gridview interface to display data from
I'm currently attempting to retrieve a list of objects from my database using jQuery.
I'm currently attempting to migrate a legacy VBA/Microsoft Access application to Python and PyQt.
I am currently attempting to use Lucene to search data populated in an index.
so currently what I am attempting to do is, remote onto a different server,
I currently have a deployed app (fortworth.herokuapp.com) that I am attempting to sort movies
I am attempting to retrieve jpeg and jpg files using the following statement: string[]
I am currently attempting to revise a Java Homework program for my Data Structures
I am currently attempting to create a bash script that will check inside of
I am currently attempting to read in Hex values from a text file. There

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.