this is the nav!
Workspace
Abdul basit Ali shaik/

# Intermediate Python

0
Beta

Run the hidden code cell below to import the data used in this course.

```.mfe-app-workspace-qcdhrn{font-size:13px;line-height:1.5384615384615385;font-family:JetBrainsMonoNL,Menlo,Monaco,'Courier New',monospace;}```# Import the course packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

# Import the two datasets
``````

### Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

means i have to create two arrays one with african country

histogram is used when there is one column we can used histogram for comparing the flactuation ir distribution in data sets

Current Type: Bar
Current X-axis: None
Current Y-axis: None
Current Color: None
``````# Add your code snippets here
for row,col in brics.iterrows():
print(f"The population of {col['country']} is {col['population']} million")
african_cont =gapminder[gapminder['cont'] == 'Africa']
life_exp = np.array(round(african_cont["life_exp"],2))
country = np.array(african_cont['country'])
# print(max(life_exp))
plt.hist(life_exp, bins = 6, range = [0,80], density=True,orientation="vertical")
plt.title("African Life Expentancies")
plt.ylabel('country')
plt.xlabel('life Expectancies')
plt.show()

``````

### Explore Datasets

Use the DataFrames imported in the first cell to explore the data and practice your skills!

• Create a loop that iterates through the `brics` DataFrame and prints "The population of {country} is {population} million!".
• Create a histogram of the life expectancies for countries in Africa in the `gapminder` DataFrame. Make sure your plot has a title, axis labels, and has an appropriate number of bins.
• Simulate 10 rolls of two six-sided dice. If the two dice add up to 7 or 11, print "A win!". If the two dice add up to 2, 3, or 12, print "A loss!". If the two dice add up to any other number, print "Roll again!".
Run cancelled