Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 ) Dow Jones Industrial Average For the following questions, the file djia.csv is provided, with the following fields: Symbol, Company. Exchange, Industry, Data added,
Dow Jones Industrial Average
For the following questions, the file djia.csv is provided, with the following fields: Symbol, Company. Exchange, Industry, Data added, Notes, and Index weighting. Data in the Symbol field are unique for each row and can be used as the index in a DataFrame.
Loading and getting information
a Use the pandas readcsv function to load the data in djia.csv into a DataFrame. Use the Symbol column as the DataFrame index. Display the data in the DataFrame.
b Use the info method to determine how many nonnull values there are for each column and what each column's type is
c Determine the number of rows and columns using the len function as well as the shape property.
d Display the first and last rows using bead and tail
Accessing rows, columns, and cells
e Display the Company column.
f Display the columns named Company and Industry in a DataFrame.
g Display the data for the row with the Symbol AAPL.
h Display the Exchange for the row with the Symbol AAPL.
Filtering, sorting
i Display the data sorted by Industry, then Company.
j Display the rows where Industry is Information Technology.
Missing values
k Display rows where Notes has a value other than missing
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