Statement of Completion#fca44e4c
Fun and Puzzles
easy
[ASSESSMENT] Anurag Testing Assessment
Resolution
Activities
Take a look at raw data¶
In [ ]:
!head world_data.csv
In [ ]:
import pandas as pd
df = pd.read_csv('world_data.csv')
df
In [ ]:
df.columns
Creating a pandas series from a dataframe df
In [ ]:
# Converting columns to pandas series
country_name = pd.Series(df['Country Name'])
country_code = pd.Series(df['Country Code'])
population = pd.Series(df[' Population, total '])
gdp = pd.Series(df['GDP, PPP (current international $)'])
internet_users = pd.Series(df['Internet users (per 100 people)'])
life_expectancy = pd.Series(df['2014 Life expectancy at birth, total (years)'])
literacy_rate = pd.Series(df['Literacy rate, adult female (% of females ages 15 and above)'])
exports = pd.Series(df['Exports of goods and services (% of GDP)'])
In [ ]:
country_name.head()
In [ ]:
country_code.head()
In [ ]:
population.head()
In [ ]:
gdp.head()
In [ ]:
internet_users.head()
In [ ]:
life_expectancy.head()
In [ ]:
literacy_rate.head()
In [ ]:
exports.head()
Activities¶
1: What is the data type?¶
In [ ]:
# try to find the dtype of `country_name`
2: What is the size of the series?¶
In [ ]:
# try to get the shape of `gdp`
3: What is the data type?¶
In [ ]:
# try to get the dtype of `internet_users`
4: What is the value of the first element?¶
In [ ]:
# try to get the value of the first element in the `population` series
5: What is the value of the last element?¶
In [ ]:
# try your code here
6: What is the value of the element with index 29?¶
In [ ]:
# try your code here
7: What is the value of the last element in the series?¶
In [ ]:
# try your code here
8: What is the mean of the series?¶
In [ ]:
# try your code here
9: What is the standard deviation?¶
In [ ]:
# try your code here
10: What is the median of the series?¶
In [ ]:
# try your code here
11: What is the minimum value of the series?¶
In [ ]:
# try your code here
12: What is the average literacy rate?¶
In [ ]:
# try to find the average literacy rate
Sorting¶
13: Sort the series in ascending order¶
In [ ]:
# try your code here
country_name_sorted = ...
14: Sort multiple series at once¶
In [1]:
# try your code here
literacy_rate_sorted = ...
country_name_sorted_by_literacy_rate = ...