Commit 0a277fb0 authored by Louis Paternault's avatar Louis Paternault
Browse files

Corrigés interractifs

parent f43760f0
import pandas
parole = pandas.read_csv("20190308-years.csv")
recherche = parole.loc[(parole['year'] == 2018), ["channel_name", "women_expression_rate"]]
for année in (1995, 2000, 2005, 2010, 2015, 2019):
print(année, parole.loc[(parole['year'] == année), ["channel_name", "women_expression_rate"]].mean())
recherche = parole.loc[(parole['year'] == 2019), ["channel_name", "women_expression_rate"]]
tri = recherche.sort_values(by="women_expression_rate")
print(tri)
import pandas
prenoms = pandas.read_csv("dpt2018.csv", sep=";")
recherche = prenoms.loc[(prenoms['dpt'] == "38") & (prenoms['annais'] == "2018"), :]
tri = recherche.sort_values(by="nombre")
print(tri)
\ No newline at end of file
année = input("Année ? ")
if not année:
année = "2019"
département = input("Département ? ")
if not département:
département = "38"
prénom = input("Prénom ? ")
prenoms = pandas.read_csv("dpt2019.csv", sep=";")
print(prenoms.loc[(prenoms['dpt'] == département) & (prenoms['annais'] == année), :].sort_values(by="nombre"))
if prénom:
print(prenoms.loc[(prenoms['dpt'] == département) & (prenoms['annais'] == année) & (prenoms['preusuel'] == prénom.upper()), :])
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment