This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df = df.set_index("date") | |
| # Supposons que l'on dispose d'une dataframe df déjà définie. | |
| # La ligne ci-dessus affecte les valeurs de la colonne "date" de df à son index. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import warnings | |
| warnings.filterwarnings("error") | |
| # Placer le code ci-dessous au début de votre code Python. | |
| # Vous pouvez maintenant utiliser la structure en | |
| # try: | |
| # # faire quelque chose | |
| # except: | |
| # # faire une chose différente | |
| # pour gérer votre warning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.datasets import make_regression | |
| X, Y, coef = make_regression( | |
| n_samples=200, # Nombre d'échantillons retournés. | |
| n_features=1, # Nombre de features retournés pour chacun des échantillons. | |
| n_informative=1, # Nombre de features utilisés pour générer le dataset. | |
| n_targets=1, # Nombre de variables à prédire. | |
| bias=-2, # Biais. | |
| noise=1, # Ecart-type du bruit gaussien rajouté au Y généré. | |
| coef=True, # Indique si l'on veut retourner le coefficient directeur. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://github.com/<UTILISATEUR>/<DEPOT> | |
| # Remplacer <UTILISATEUR> par le nom de l'utilisateur à qui appartient le dépôt. | |
| # Remplacer <DEPOT> par le nom du dépôt. | |
| # Par exemple, l'instruction suivante permet de cloner le dépôt "example-repository" de l'utilisateur "ladatascience": | |
| # git clone https://github.com/ladatascience/example-repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| python --version | |
| # Peut retourner par exemple: | |
| # Python 3.9.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| where python | |
| # Par exemple, ceci peut retourner: | |
| # C:\ProgramData\Anaconda3\python.exe | |
| C:\Users\<NOM D'UTILISATEUR>\AppData\Local\Microsoft\WindowsApps\python.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conda create --name <NOM DE L'ENVIRONNEMENT> | |
| # Par exemple, si on veut créer un environnement "venvconda" (pour virtual environment Anaconda), on fera: | |
| # conda create --name venvconda |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conda create --name <NOM DE L'ENVIRONNEMENT> python=<VERSION DE PYTHON> | |
| # Par exemple, pour créer un environnement virutel appelé "venvconda" et avec une version 3.6.5 de Python, on utilisera: | |
| # conda create --name venvconda python=3.6.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conda deactivate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conda env remove --name <NOM DE L'ENVIRONNEMENT> | |
| # Par exemple, pour supprimer un environnement qui s'appelle venvconda, on fera: | |
| # conda env remove --name venvconda |