Data analyzing a csv file into list, not getting the same result as my teacher

Question:

I am a beginner to python.

I am working on an assignment where I have to

  1. import pandas library
  2. read a csv file
  3. analyze dataframe by making them into a list
  4. use loops to find specific word in each row of list

When I try to pull certain values from the list according to the word "New York" it is pulling numbers that do not have the word "New York" in the row.

I have attached my code and my teachers code as an example. I am trying to get my output to look like my teachers. Please let me know if you need anything else. Thank you!

my code and output

my teachers code and output

Asked By: nay nay

||

Answers:

you are missing a tab in print (‘Order Amount: $’). so the order amount and running total are not filtered. enter image description here

Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.