Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A list of steps to do this is sufficient The file banks_and_branches.csv contains data on the number of commercial banking institutions, branches, and offices in
A list of steps to do this is sufficient
The file "banks_and_branches.csv" contains data on the number of commercial banking institutions, branches, and offices in the United States at the end of each year between 1934 to 2017. (This data is maintained by the Federal Deposit Insurance Corporation (FDIC) and can be downloaded from https://www5.fdic.gov/hsob/SelectRpt.asp?Entry Typ=10&Header=1, series CB01. The FDIC has a lot of interesting banking data. You are encouraged to browse around their website to see what's there -- this might be a useful source for your final project.) Your task is to import this data into Python. Part (a): Import the data from "banks_and_branches.csv" into a Pandas data frame called banking_data . If you open the .csv file in Excel or a similar program, you'll notice that there are notes in several of the cells at the beginning of the file. Rather than delete these manually, you should use the header option in pandas.read_csv to use the correct row for the column names. n [17]: Edit Attachments banking_data = pd.read_csv ("banks_and_branches.csv") banking_data.head() "ut[17]: Year Institutions Branches Offices 0 2017 4,918 79,163 84,081 1 2016 5,112 80,08985,201 2 2015 5,340 81,541 86,881 3 2014 5,607 81,990 87,597 4 2013 5,847 82,735 88,582 Part (c): You'll notice that some of the columns are listed as objects and not integers. Convert these columns to integers. Note that you'll need to remove the thousands separator (",") from each number first. Print the data types of each column to confirm that they are all integers. Later, we will need a variable containing the average number of offices per institution in each year. Add a new column called 'offices_per_bank' to banking data with this information. Edit Attachments banking_data.replace(':',') The file "banks_and_branches.csv" contains data on the number of commercial banking institutions, branches, and offices in the United States at the end of each year between 1934 to 2017. (This data is maintained by the Federal Deposit Insurance Corporation (FDIC) and can be downloaded from https://www5.fdic.gov/hsob/SelectRpt.asp?Entry Typ=10&Header=1, series CB01. The FDIC has a lot of interesting banking data. You are encouraged to browse around their website to see what's there -- this might be a useful source for your final project.) Your task is to import this data into Python. Part (a): Import the data from "banks_and_branches.csv" into a Pandas data frame called banking_data . If you open the .csv file in Excel or a similar program, you'll notice that there are notes in several of the cells at the beginning of the file. Rather than delete these manually, you should use the header option in pandas.read_csv to use the correct row for the column names. n [17]: Edit Attachments banking_data = pd.read_csv ("banks_and_branches.csv") banking_data.head() "ut[17]: Year Institutions Branches Offices 0 2017 4,918 79,163 84,081 1 2016 5,112 80,08985,201 2 2015 5,340 81,541 86,881 3 2014 5,607 81,990 87,597 4 2013 5,847 82,735 88,582 Part (c): You'll notice that some of the columns are listed as objects and not integers. Convert these columns to integers. Note that you'll need to remove the thousands separator (",") from each number first. Print the data types of each column to confirm that they are all integers. Later, we will need a variable containing the average number of offices per institution in each year. Add a new column called 'offices_per_bank' to banking data with this information. Edit Attachments banking_data.replace(':',')Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started