Question
Please use Python for this question(Libraries you need for this questions are: pandas, numpy and matplotlib). A company has recorded its revenue, advertising cost, profitability
Please use Python for this question(Libraries you need for this questions are: pandas, numpy and matplotlib).
A company has recorded its revenue, advertising cost, profitability for the past twelve months. Please use the following code to create the dataFrame.
df = pd.DataFrame({"revenue":[57,68,63,71,72,90,80,62,59,51,47,52], "advertising":[2.1,1.9,2.7,3.0,3.6,3.2,2.7,2.4,1.8,1.6,1.3,1.9],
"profitability":[1,2,3,2,np.nan,1,3,2,2,1,2,2],
"month":np.arange(1,13,1) })
Please finish the following questions in sequence and write your code in the text field.
Display a summary of the basic data type information
Display a summary of the basic descriptive statistics information(count, mean, min., max) for all variables
Return the first 5 rows of the data
Check whether there are missing values in this dataset, drop missing values if there are
Calculate the sum of all 12 months revenue
Select the rows where profitability greater than 1 and revenue less than 70
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