Skip to content

iamshihshan/PyOllyTutorial

Repository files navigation

PyOllyTutorial

Basic Python for Data


Other Hand Out

Chat Sheet List for Data Scientists


Miniconda Jupyter Notebook Installation

  1. Install Miniconda
  2. Install Jupyter in Anaconda Prompt CMD :
pip install jupyter
  1. Create Python/R Kernel with essentials package
conda create -n myenv python=3.12
conda create -n myenv r r-essentials 
  1. Activate/Deactivate Kernel
conda activate myenv
conda deactivate
  1. Install Module/packages within activated kernel
conda install openpyxl sqlalchemy pyodbc pyhive opencv numpy scipy sympy pandas matplotlib requests lxml patsy scikit-learn xlrd requests BeautifulSoup4 bokeh
conda install r-irkernel
  1. Install Jupyter Notebook within activated kernel
conda install jupyter
  1. Remove Env
conda remove --name myenv --all
  1. Add Env into Kernal in Jupyter Notbook
activate myenv
pip install ipykernel
python -m ipykernel install --user --name myenv --display-name "Python (whatever you want to call it)"
  1. Remove Kernal in Jupyter Notebook
jupyter kernelspec list
jupyter kernelspec remove <kernel_name>
  1. More Info Conda info / Conda Chat Sheet

How to Link Sublime Text Build System to Python

  1. Go to Sublime Text : Tools -> Build System -> New Build System
  2. Paste code as below:
{
    "cmd": ["python3", "-i", "-u", "$file"],
    "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
    "selector": "source.python"
}

(if want to use conda env use below code instead)

{
    "cmd": ["C:\\Users\\sschen\\.conda\\envs\\myenv\\python.exe", "-u", "$file"],
    "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
    "selector": "source.python"
}
  1. Save it with a meaningful name like: Python3.sublime-build
  2. Go to Sublime Text : Tools -> Build system -> and check Python3
  3. Paste code below and save as python file:
import sys
print(sys.version)
  1. Test if executable press : Ctrl + b

How to Set Personalized "Pause Key" in Sublime

  1. Go to Sublime Text : Preference -> Key Bindings-User
  2. Paste code as below:
{"keys": ["ctrl+shift+c"], "command": "exec", "args": {"kill": true} } 
  1. Save it
  2. Test if executable press : Ctrl + Shift + c

Sublime Hot Key

  1. Select whole line : Ctrl + l
  2. Push forward/back : Ctrl+ [ / Ctrl + ]
  3. Edit all keyword : select one of your word then Alt + F3
  4. Edit part of keyword : select one of your word then **Ctrl + d **
  5. Delete one line : Ctrl + x
  6. Add one line above/below : Ctrl + Shift + Enter / Ctrl + Enter

How to Install Module for Specific Python Version

python2 -m pip install ModuleName1 ModuleName2 ...
python3 -m pip install ModuleName1 ModuleName2 ...

OR

python3 -m pip --proxy http://XX.X.XX.XX:8080 install ModuleName1 ModuleName2

How to Add Virtual Env for Python

The Env path should be at the path you did cmd in defult

python -m venv EnvName
EnvName\Scripts\activate
deactivate

About

Basic Python for Data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published