mirror of
https://git.roussel.pro/telecom-paris/GIN206.git
synced 2026-02-09 02:30:17 +01:00
ajout fonctions de base pour parse des données et les analyser
This commit is contained in:
10
poll.py
Normal file
10
poll.py
Normal 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
|
||||
Reference in New Issue
Block a user