Question: Instructions 3 3 hide - Create a variable called filter _ criteria to select the appropriate rows from the merged table so that you can

Instructions 33
hide -
Create a variable called filter_criteria to select the appropriate rows from the merged table so that you can sum the rides column.
The previous output can be found in the Shell tab.
# Merge the ridership, cal, and stations tables
ridership_cal_stations = ridership.merge ,
on=['year', 'month', 'day'])
.merge(stations,
on='station_id')
# Create a filter to filter
ridership_cal_stations
filter_criteria =
((ridership_cal_stations['month']==
&
(ridership_cal_stations['day_type' ]==
&
(ridership_cal_stations['station_name']==
)
# Use . loc and the filter to select for rides
print(ridership_cal_stations.loc[filter_criteria
'rides'].sum())
 Instructions 33 hide - Create a variable called filter_criteria to select

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!