Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSV file challenges
#1
Hello, new to python programming but have an assignment that I have completed 99% of the requirements. The last part is driving me crazy--I have googled, searched in my notes, tried to find resources in the library (final resort).

I have a Dataframe that uses 3 different CSV files. One of the three is missing 2 columns of data (gender and birth year). However, I tried to write an If statement, a while statement, create a new file and import it when the conditions of the 2 other cities were met, but nothing is working for me.

I am not looking for the answer--just an idea of where I can look for it. This was my last attempt--it works for chicago and new york city, but I still get errors when I select washington.

anyhelp would be appreciated

city = get_filters
    if city == 'chicago' or city == 'new york city':
        print('\033[1m' + 'Calculating Gender and Age stats...\n' + '\033[0m')
        start_time = time.time()

        print('\nGender:\n')

        gender = df['Gender'].value_counts()
        print(gender)
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020