pandas basics#
california_cities.csv contains the population and area in km2 for california cities
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
URL = "http://www-sop.inria.fr/members/Arnaud.Legout/formationPython/Exos/california_cities.csv"
# we extract only 3 columns
cities = pd.read_csv(URL)[["city", "area_total_km2", "population_total"]]
Explore the dataset with info() and describe()#
# your code
How many cities with the 25% largest population ?#
# your code
Get the name of the cites with the 25% largest area#
# your code
What is the area and population of Berkeley?#
# your code
Which cities have between 110k and 120k inhabitants?#
# your code