Spaces:
Runtime error
Runtime error
# AUTOGENERATED! DO NOT EDIT! File to edit: ../update_classement.ipynb. | |
# %% auto 0 | |
__all__ = ['PAGE', 'html_tables', 'df_adherents', 'get_classement', 'add_classements'] | |
# %% ../update_classement.ipynb 2 | |
PAGE = 'https://badmania.fr/club-joueurs-2254-riom-badminton-club.html' | |
# %% ../update_classement.ipynb 3 | |
import pandas as pd | |
html_tables = pd.read_html(PAGE) | |
df_adherents = html_tables[0] | |
# %% ../update_classement.ipynb 7 | |
def get_classement( | |
license_number,# le numero de license | |
): | |
# print(license_number) | |
if len(df_adherents[df_adherents['Licence'] == license_number]['Class.'].values)>0: | |
return df_adherents[df_adherents['Licence'] == license_number]['Class.'].values[0] | |
else: | |
return '' | |
# %% ../update_classement.ipynb 19 | |
def add_classements(dataframe, #le dataframe des adherents | |
): | |
dataframe = dataframe.copy() | |
dataframe['Classement']= dataframe['Licence'].apply(lambda x: get_classement(x)) | |
return dataframe | |