Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions