You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
544 B
47 lines
544 B
# In[1]:
|
|
|
|
|
|
#Importer les librairies
|
|
import pandas as pd
|
|
|
|
|
|
# In[2]:
|
|
|
|
|
|
#Ouvrir un fichier CSV
|
|
#Ajout d'un séparateur des colonnes
|
|
df = pd.read_csv (r'/Users/marinegalanth/Desktop/inondation_bdd/bd_inondation/cedex.csv',sep = ';')
|
|
print(df)
|
|
|
|
|
|
# In[3]:
|
|
|
|
|
|
#Renommer les colonnes sélectionnées
|
|
df = df.rename(columns={'Code INSEE': 'codepostal', 'Libellé': 'libelle', 'Code Postal / CEDEX': 'cedex'})
|
|
|
|
|
|
# In[4]:
|
|
|
|
|
|
df=df[["codepostal","libelle","cedex"]]
|
|
|
|
|
|
# In[5]:
|
|
|
|
|
|
#Créer un dataframe
|
|
df1 = pd.DataFrame(df)
|
|
|
|
|
|
# In[6]:
|
|
|
|
|
|
df1
|
|
|
|
|
|
# In[ ]:
|
|
|
|
|
|
|
|
|