Question: This assignment has two parts: processing 2 csv files related to City Bike ridership for the same month in different years and comparing the two

This assignment has two parts: processing 2 csv files related to City Bike ridership for the
same month in different years and comparing the two files.
Part 1:
Input: No input from the user required. The input file names to use in the script are NYC-CitiBike-Mar17.csv
and NYC-CitiBike-Mar23.csv
Please note:
file name has to be without its complete file path. For example: c:/stevens/em624/ NYC-CitiBike-
Mar17.csv is NOT right. If you change platform or move the file to another directory, the script
wouldnt work. Be sure your script and your file are in the same directory.
No data structure management library (like pandas) should be used for this assignment.
The two files use a slightly different structure. In the Mar17 one, user type is defined as "User Type",
and this can be "Subscriber" (meaning users with a subscription) or "Customer" (meaning
occasional users). In the Mar23 one, user type is defined as " member_casual" and this can be
"member" (meaning users with a subscription) or "casual" (meaning occasional users).
Output: Skip a line/print a blank line, then print per each file:
o The file has n lines (n1 will be for Mar17, n2 for Mar23). Of those n:
Mar17: x1 of them have "Customer" as usertype, y1 have "Subscriber" as usertype. "Customer"
are z1% of the total
Mar23: x2 of them have "casual" as member_casual, y2 have "member" as member_casual.
"casual" are z2% of the total
Procedure:
1. Open the files.
2. Loop into the files.
3. For each file:
a. Count the number of lines - Note: skip the header. You will get 2 number: n1 for Mar17 and
n2 for Mar23.
b. Count of the number of lines with: (Mar17) "Customer" as usertype (this is x1) or (Mar23)
"casual" as member_casual (this is x2).
c. Count of the number of lines with: "(Mar17)" Subscriber" as usertype (this is y1) or (Mar23)
"member" as member_casual (this is y2).
d. Calculate the z1% of "Customer" in Mar17- Calculate the z2% of "casual" in Mar23.
e. Print: The file has n lines. Of those x are occasional users, y have a subscription. Occasional
users are z% of the total.
Part 2:
Input: No input from the user required. Use the data from Part 1
Output: Comparison of the data in the 2 files. Considering the files are related to different periods, we want
to compare them to optimize the bike availability. In particular, because one file is related to data before the
pandemic while the other is after, we want to evaluate the impact of the pandemic on the ridership.
Procedure:
1. Check IF n1>n2:
IF n1>n2, print: The Mar17 riders are more than the Mar23
else, print: The Mar23 riders are more or equal than the Mar17
2. Check IF z1>z2:
IF z1>z2, print: Before the pandemic there were more occasional users than after the
pandemic
else, print: After the pandemic there were more or equal occasional users than before the
pandemic
3. Write a 1 page interpretation. The interpretation would be a narrative describing/explaining in plain
English the results of your Python script.
Submit the 3 parts as a single .py file via Canvas and the interpretation in a separate doc/pdf file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!