Python Data Science Snippets

This article needs update! Jupyter Installation pip in venv mkdir newdir && cd newdir python -m venv .venv (1) source .venv/bin/activate (2) pip install jupyter numpy pandas sqlalchemy (3) pip freeze > requirements.txt (4) python -m jupyter lab (5) deactivate (6) 1 create a new virtual environment 2 activate the environment 3 install several libraries into the activated environment 4 create a list with all dependencies install for sharing or reinstallation later 5 start jupyter 6 having finished we might want to exit the virtual environment ...

July 8, 2020 · 2 min · 244 words · Micha Kops

Python Snippets

Virtual Environments Create and activate a venv python -m venv /path/to/new-env (1) source /path/to/new-env/bin/activate (2) 1 Creates a new virtual environment 2 Activate the new virtual environment Deactivate venv deactivate Save used dependencies to a file pip freeze > dependencies.txt Install dependencies from file pip install -r dependencies.txt Storing and fetching Credentials from the System Keyring I am using jaraco/keyring here: pip install keyring import keyring keyring.set_password("system", "db.sample.password", "xoxo") print(keyring.get_password("system", "db.sample.password")) ...

March 1, 2010 · 1 min · 100 words · Micha Kops