diff --git a/.gitignore b/.gitignore index 5d0cce2..0a7201e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,162 @@ -notes\ cours\ python + +# Created by https://www.gitignore.io/api/vim,python,visualstudiocode +# Edit at https://www.gitignore.io/?templates=vim,python,visualstudiocode + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +# End of https://www.gitignore.io/api/vim,python,visualstudiocode diff --git a/ML/udemy/Data.csv b/ML/udemy/Data.csv new file mode 100755 index 0000000..564b65b --- /dev/null +++ b/ML/udemy/Data.csv @@ -0,0 +1,11 @@ +Country,Age,Salary,Purchased +France,44,72000,No +Spain,27,48000,Yes +Germany,30,54000,No +Spain,38,61000,No +Germany,40,,Yes +France,35,58000,Yes +Spain,,52000,No +France,48,79000,Yes +Germany,50,83000,No +France,37,67000,Yes \ No newline at end of file diff --git a/ML/udemy/fill_empty_data.py b/ML/udemy/fill_empty_data.py new file mode 100644 index 0000000..06c6970 --- /dev/null +++ b/ML/udemy/fill_empty_data.py @@ -0,0 +1,21 @@ +# Data preprocessing +import numpy as np +import matplotlib.pyplot as plt +import pandas as pd + +# Importing the dataset +dataset = pd.read_csv('Data.csv') +# Create the matrix of features (independant variables) +# [:, = lines -- all of them +# :-1] = colums -- all of them unless the last one +# X = (Country, Age, Salary) +X = dataset.iloc[:, :-1].values +# Create vector of linked variables +# [:, 3] = all values of the 3rd column +# Y = (Purchased) +X = dataset.iloc[:, 3].values + +# Taking care of the missing data +from sklearn.model_selection import train_test_split + +imputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis = 0) diff --git a/edx-python/w1/problem3-w1.py b/edx-python/w1/problem3-w1.py index 7fa0217..d6046a4 100644 --- a/edx-python/w1/problem3-w1.py +++ b/edx-python/w1/problem3-w1.py @@ -4,4 +4,8 @@ alphabet = string.ascii_lowercase s = 'azcbobobegghakl' count = 0 +print(alphabet) +for i in s: + print i + print index(i)