Skip to content

Instantly share code, notes, and snippets.

@vinkrish
Last active July 28, 2025 18:22
Show Gist options
  • Save vinkrish/3db645850287398e444d18adb46f6ae8 to your computer and use it in GitHub Desktop.
Save vinkrish/3db645850287398e444d18adb46f6ae8 to your computer and use it in GitHub Desktop.
pip list
pip list --local
pip freeze -> prints all installed library
Upgrade pip:
python3 -m pip install --upgrade pip
python -m pip install findspark
pip3 install -r requirements.txt
jupyter notebook
Shift+Enter : run notebook​ cell
Shift+Tab : opens documentation
.Tab : code suggest
#comment
'''Multi line comment'''
Create Virtual Environment:
python3 -m venv venv
Create a virtual environment using the virtualenv:
virtualenv venv --python=python3.7
Activate the Virtual Environment:
source venv/bin/activate
(or)
venv\Scripts\activate (Windows)
pip3 install Flask-RESTful
Install Dependencies:
pip3 install -r requirements.txt
Verify Installation:
pip3 list
To stop:
deactivate
To remove:
rm -rf venv
pip3 uninstall -r requirements.txt -y
Instead of uninstalling all global packages, save the diff and only uninstall those package when running on global:
pip3 freeze > before.txt
pip3 freeze > after.txt
diff before.txt after.txt
pip3 uninstall -r newly_installed.txt -y
jupyter notebook titanic_survival_exploration.ipynb
for inline equation in MathJax:
pip install https://github.com/mitya57/python-markdown-math/archive/master.zip
#Image Classification
python retrain.py --image_dir=./flower_photos
tensorboard --logdir /tmp/retrain_logs
python try-retrain.py test-images/tulip2.jpg
# Jupyter to view groupby items
for key, item in group:
print(group.get_group(key), "\n")
Anaconda:
conda create -n aggregation-framework python=3.6 anaconda
source activate aggregation-framework
jupyter notebook
# now open http://localhost:8888/
# any notebooks (ipynb files) that you place in the aggregation-framework directory or any of its subdirectories will appear and be executable in this interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment