Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Data Visualisation Quality Water
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Besson Lucas
Data Visualisation Quality Water
Commits
9180c606
Commit
9180c606
authored
3 months ago
by
Gilares Paul
Browse files
Options
Downloads
Patches
Plain Diff
Edit classement_dpt.py
parent
c29c2709
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tests/classement_dpt.py
+5
-5
5 additions, 5 deletions
src/tests/classement_dpt.py
with
5 additions
and
5 deletions
src/tests/classement_dpt.py
+
5
−
5
View file @
9180c606
# Fonction d'exploration des données : compte le nombre d'occurences de chaque département (i.e. combien de prélèvements par départements)
# ici dans la Table des résultats de l'année 2024 (1ère année que nous avons exploré)
# nous a servi à voir si la répartition des prélèvements était plutôt uniforme nationalement, découverte du jeu de données
import
pandas
as
pd
def
count_occurrences
(
csv_file
):
# Read the CSV file
df
=
pd
.
read_csv
(
csv_file
)
# Count occurrences of each value in the 'cdparametre' column
occurrences
=
df
[
'
cddept_x
'
].
value_counts
()
return
occurrences
if
__name__
==
"
__main__
"
:
csv_file
=
"
data/processed/Table2024.csv
"
# Replace with your CSV file path
csv_file
=
"
data/processed/Table2024.csv
"
occurrences
=
count_occurrences
(
csv_file
)
print
(
occurrences
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment