""" Felix Muzny DS 2000 Lecture 11 - starter code October 15, 2024 Data file (all sept 2024 ebike trips starting at Forsyth) Three columns: - end station name - end station latitude (latitude is flatitude) - end station longitude (longitude is veritcal) Goals for today’s code: - read a csv into a list of lists - how many trips were to "Brigham Circle - Francis St at Huntington" - where did the BlueBikes riders go from NEU in September? """ import matplotlib.pyplot as plt # to help us read CSVs import csv FILENAME = "bluebikes_forsyth_100.csv" STATION_OF_INTEREST = "Brigham Circle - Francis St at Huntington Ave" FORSYTH_LAT = 42.339202 FORSYTH_LONG = -71.090511 STATION_COL = 0 LAT_COL = 1 LONG_COL = 2 def read_csv(filename): ''' Function: read_csv parameter: filename, a string Returns: 2d list of strings, the contents of the file ''' data = [] # with open(filename, "r") as infile: # our code will go here! return data def get_station(data, station_name, col): """ Get all rows from the data where the station name matches, assuming station names occer at the given column :param data: list of lists of strings :param station_name: string station name to search for :param col: int column to look in for the station name :return: list of ints """ new_rows = [] # our code will go here! return new_rows # if there's time, we'll also want to... def plot_locations(data, lat_col, long_col, begin_lat, begin_long): """ Make a scatter plot of all the end locations given by the lat and long columns in the data. Plot one point as a special point to differentiate it from the others :param data: list of lists of strings :param lat_col: int column with the latitude information :param long_col: int column with the longitude information :param begin_lat: int special point's latitude :param begin_long: int special point's longitude :return: nothing """ # our code will go here! print("placeholder for plotting") # plt.legend() # plt.show() # main will be the control center def main(): print("lec 11 - bluebikes") # 1: gather data data = read_csv(FILENAME) # explore the data a bit #2: get the rows for the station we care about # how many trips to the station we care about? # 3: if time, let's plot the trips! main()