Script Python permettant de nettoyer et préparer nos données csv.
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.

70 lines
2.2 KiB

2 years ago
  1. #Importation des données dont nous aurons besoin
  2. from typing import List
  3. import pandas as pd
  4. import numpy as np
  5. import requests
  6. import csv
  7. import re
  8. #Afficher les tableaux de données
  9. datafram : pd.read_csv("C:\\Users\\luigg\\Data_cleaning\\Table_final.csv")
  10. datafram.head(5)
  11. #Supprimer les colonnes inutilisées ou non pertinentes
  12. to_drop : [''identifiant
  13. ','adresse
  14. ','commune
  15. ','coordonnees_x
  16. ','coordonnees_y
  17. ','code_epsg
  18. ','code_ape
  19. ','libelle_ape
  20. ','code_eprtr
  21. ','libelle_eprtr
  22. ','sigleUniteLegale_imp
  23. ','activitePrincipaleUniteLegale_imp
  24. ','Catégorie_entreprise_imp
  25. ','numeroVoieEtablissement_imp
  26. ','typeVoieEtablissement_imp
  27. ','libelleVoieEtablissement_imp
  28. ','libelleCommuneEtablissement_imp
  29. ','codeCommuneEtablissement_imp
  30. ','adresse_imp
  31. ','geo_imp
  32. ','com_code_imp
  33. ','code_commune_imp
  34. ','Code Officiel_EPCI_imp
  35. ','Code_Officiel_region_imp
  36. ','codenaffix_imp
  37. ','Intitule_NAF_imp
  38. ','groupe_imp
  39. ','division_imp
  40. ','nom_etablissement_tndan
  41. ','code_operation_eliminatio_valorisation_tndan
  42. ','libelle_operation_eliminatio_valorisation_tndan
  43. ','code_departement_tndan
  44. ','pays_tndan
  45. ','pays_pdan
  46. ','code_dechet_pdan
  47. ','libelle_dechet_pdan
  48. ','quantite_pdan
  49. ','unite_pdan
  50. ','code_operation_eliminatio_valorisation_pndan
  51. ','libelle_operation_eliminatio_valorisation_pndan
  52. ','code_departement_pndan
  53. ','pays_pndan
  54. ','code_dechet_pndan
  55. ','libelle_dechet_pndan
  56. ','quantite_pndan
  57. ','unite_pndan
  58. ','code_operation_eliminatio_valorisation_tdan
  59. ','libelle_operation_eliminatio_valorisation_tdan
  60. ','code_departement_tdan
  61. ','pays_tdan
  62. ','code_dechet_tdan
  63. ','libelle_dechet_tdan
  64. ']
  65. datafram.drop(to_drop, inplace = True, axis = 1)
  66. datafram.head(5)