# coding: utf-8 # ## Section 5 Homework - Fill in the Blanks # Import the packages needed to perform the analysis import _ as pd import _ as np import _ as plt import _ as sns # Load the data provided for the exercise # Import the csv dataset data = _("P4-Demographic-Data.csv") # Explore the data # Visualize the dataframe data # Rename the column names data._ = ['CountryName', 'CountryCode', 'BirthRate', 'InternetUsers', 'IncomeGroup'] # Check top 6 rows data._(6) # Check bottom 7 rows data._(7) # Check the structure of the data frame data._() # Check the summary of the data data._() # ### Request 1 # You are employed as a Data Scientist by the World Bank and you are working on a project to analyse the World’s demographic trends. # # You are required to produce a scatterplot illustrating Birth Rate and Internet Usage statistics by Country. # # The scatterplot needs to also be categorised by Countries’ Income Groups. # Plot the BirthRate versus Internet Users categorized by Income Group vis1 = sns._( data = data, x = '_', y = '_', fit_reg = False, hue = '_', size = 10 ) #request 2 #find the counties that have internt users between 20 and 80 newdf = data[(_._>20) & ( _.Internetusers <40 )] # Plot the BirthRate versus Internet Users categorized by Income Group on newdf frame vis2 = sns._( data = newdf, x = '_', y = '_', fit_reg = False, hue = '_', size = 10 )
# coding: utf-8
# ## Section 5 Homework - Fill in the Blanks
# Import the packages needed to perform the analysis
import _ as pd
import _ as np
import _ as plt
import _ as sns
# Load the data provided for the exercise
# Import the csv dataset
data = _("P4-Demographic-Data.csv")
# Explore the data
# Visualize the dataframe
data
# Rename the column names
data._ = ['CountryName', 'CountryCode', 'BirthRate', 'InternetUsers', 'IncomeGroup']
# Check top 6 rows
data._(6)
# Check bottom 7 rows
data._(7)
# Check the structure of the data frame
data._()
# Check the summary of the data
data._()
# ### Request 1
# You are employed as a Data Scientist by the World Bank and you are working on a project to analyse the World’s demographic trends.
#
# You are required to produce a scatterplot illustrating Birth Rate and Internet Usage statistics by Country.
#
# The scatterplot needs to also be categorised by Countries’ Income Groups.
# Plot the BirthRate versus Internet Users categorized by Income Group
vis1 = sns._( data = data, x = '_', y = '_', fit_reg = False, hue = '_', size = 10 )
#request 2
#find the counties that have internt users between 20 and 80
newdf = data[(_._>20) & ( _.Internetusers <40 )]
# Plot the BirthRate versus Internet Users categorized by Income Group on newdf frame
vis2 = sns._( data = newdf, x = '_', y = '_', fit_reg = False, hue = '_', size = 10 )
Trending now
This is a popular solution!
Step by step
Solved in 2 steps