ajout fonctions de base pour parse des données et les analyser

This commit is contained in:
Quentin Roussel
2024-05-01 23:30:31 +02:00
parent 239aa49d7f
commit e6cfd468a6
10 changed files with 167653 additions and 0 deletions

10
poll.py Normal file
View File

@@ -0,0 +1,10 @@
def sample_every_kth_point(df, k):
# Validate the input to ensure k is positive and does not exceed the DataFrame length
if k <= 0:
raise ValueError("k must be a positive integer.")
if k > len(df):
raise ValueError("k is greater than the number of rows in the DataFrame.")
# Sample every k-th point
sampled_df = df.iloc[::k]
return sampled_df