Getting Started w/ Python: Difference between revisions
(→Setup) |
|||
(27 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
== Installation | == Installation == | ||
# Install [https://www.python.org/downloads/ Python for Windows] | # Install [https://www.python.org/downloads/ Python for Windows] | ||
Line 11: | Line 11: | ||
### Jupyter | ### Jupyter | ||
== Setup == | == Setup pySara == | ||
# Create a Working Directory (Documents > FOQA) | # Create a Working Directory (Documents > FOQA) | ||
Line 17: | Line 17: | ||
## File > Open Folder > Select Folder | ## File > Open Folder > Select Folder | ||
## If prompted, Trust the folder | ## If prompted, Trust the folder | ||
# Download pySara from Teams > FOQA > Files > Python > pysara.zip and extract to your new working directory | |||
# From the pysara folder extracted to your working directory, double click on Getting Started.ipynb. It should open in VSCode | |||
# Download pySara from Teams > FOQA > Files > Python > pysara.zip and extract to your working directory | # To install required libraries: | ||
# From the pysara folder extracted to your working directory, double click on Getting Started.ipynb | #* Terminal menu > New Terminal | ||
# To install libraries | #* pip install pandas seaborn numpy requests plotly | ||
# | # Follow the instructions in the notebook to install | ||
== Jupyter Introduction == | == Jupyter Introduction == | ||
# Cell Types: Code and Markup | |||
# Shortcuts (hit escape to enter command mode) | |||
#* Shift Enter: Execute Cell | |||
#* A: Add Cell Above | |||
#* B: Add Cell Below | |||
#* DD: Delete Cell | |||
#* F: Find/Find and Replace | |||
#* Enter: Enter edit mode | |||
# Markdown | |||
#* Headers | |||
#* Lists | |||
# Markdown Guide: https://www.ibm.com/docs/en/watson-studio-local/1.2.3?topic=notebooks-markdown-jupyter-cheatsheet | |||
== Python Introduction == | |||
* Good Tutorial | |||
*# Open https://github.com/jvdkwast/Python3_Jupyter_Notebook | |||
*# Click Code > Download ZIP | |||
*# Download to your working directory and Extract | |||
*# Double click on PythonIntro.ipynb | |||
* Python Basics | |||
*# whitespace | |||
*# imports & libraries | |||
*# Variables (numbers, strings, lists, tuples, dictionaries, objects) | |||
*# functions | |||
*# looping | |||
*# if, elif, else | |||
== Pandas and Data Manipulation == | == Pandas and Data Manipulation == | ||
* Pivot Tables | |||
* Plotting | |||
** [https://www.w3schools.com/python/pandas/pandas_plotting.asp Matplotlib] | |||
** [https://elitedatascience.com/python-seaborn-tutorial Seaborn] | |||
** [https://plotly.com/python/getting-started/ Plotly] | |||
== Python and Proxies == | |||
PIP (primary package manager for python) will use the following locations on windows: | |||
* User: C:\Users\<<username>>\pip\pip.ini | |||
* User: C:\Users\<<username>>\AppData\Roaming\pip\pip.ini | |||
* System: C:\ProgramData\pip\pip.ini | |||
Create a pip.ini file in one of these locations, and then copy these contents into it: | |||
<pre> [global] | |||
trusted-host = pypi.python.org | |||
pypi.org | |||
files.pythonhosted.org | |||
proxy = https://internet.proxy.fedex.com:3128 | |||
</pre> |
Latest revision as of 16:13, 13 January 2023
Installation
- Install Python for Windows
- Add Python to Environment Variables (Checked)
- Install VSCode for Windows
- From Extensions, install the following:
- Python
- Jupyter
- From Extensions, install the following:
Setup pySara
- Create a Working Directory (Documents > FOQA)
- Open Working Directory from VSCode
- File > Open Folder > Select Folder
- If prompted, Trust the folder
- Download pySara from Teams > FOQA > Files > Python > pysara.zip and extract to your new working directory
- From the pysara folder extracted to your working directory, double click on Getting Started.ipynb. It should open in VSCode
- To install required libraries:
- Terminal menu > New Terminal
- pip install pandas seaborn numpy requests plotly
- Follow the instructions in the notebook to install
Jupyter Introduction
- Cell Types: Code and Markup
- Shortcuts (hit escape to enter command mode)
- Shift Enter: Execute Cell
- A: Add Cell Above
- B: Add Cell Below
- DD: Delete Cell
- F: Find/Find and Replace
- Enter: Enter edit mode
- Markdown
- Headers
- Lists
- Markdown Guide: https://www.ibm.com/docs/en/watson-studio-local/1.2.3?topic=notebooks-markdown-jupyter-cheatsheet
Python Introduction
- Good Tutorial
- Open https://github.com/jvdkwast/Python3_Jupyter_Notebook
- Click Code > Download ZIP
- Download to your working directory and Extract
- Double click on PythonIntro.ipynb
- Python Basics
- whitespace
- imports & libraries
- Variables (numbers, strings, lists, tuples, dictionaries, objects)
- functions
- looping
- if, elif, else
Pandas and Data Manipulation
- Pivot Tables
- Plotting
Python and Proxies
PIP (primary package manager for python) will use the following locations on windows:
- User: C:\Users\<<username>>\pip\pip.ini
- User: C:\Users\<<username>>\AppData\Roaming\pip\pip.ini
- System: C:\ProgramData\pip\pip.ini
Create a pip.ini file in one of these locations, and then copy these contents into it:
[global] trusted-host = pypi.python.org pypi.org files.pythonhosted.org proxy = https://internet.proxy.fedex.com:3128