Question: Define a function called filter _ by _ year that takes a dataset such as baseball _ data and a year as input and outputs

Define a function called filter_by_year that takes a dataset such as baseball_data and a year as input and outputs subsets of each table in the dataset that include only data from that year. Then, filter baseball_data to include only data from 1987, print the first two rows of each dataframe within the filtered dataset, and examine the data.
Please do not modify or write any code above the preset code:
def filter_by_year(baseball_data, year):
#---Your code starts here---
#---Your code stops here---
filtered_data = filter_by_year(baseball_data, 1987)
#---Your code starts here---

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!