Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code. The language provides constructs intended to enable clear programs on both a small and large scale.
python --version
- Show the system version
brew install python3
- If you want python3
A package is a library of code. Instead of having everyone rewrite the same code it is shared openly and can be downloaded by others easily. Python libraries are hosted on a service called they Python Package Index or PyPI
sudo easy_install pip
- pip is a package management system used to install and manage software packages written in Python.
If you want to use anaconda you are on your own :)
pip install -U scipy
- SciPy (pronounced “Sigh Pie”) is open-source software for mathematics, science, and engineering.pip install -U numpy
- NumPy is the fundamental package for scientific computing with Python.pip install -U pandas
- A Dataframe that is used to read, transform, and manipulate datapip install -U scikit-learn
- Sci-Kit Learn is a Simple and efficient tools for data mining and data analysispip install -U matplotlib
- matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platformspip install -U jupyter
- A Jupyter Notebook is web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text.
- Change into the right directory
cd ~/datasci
jupyter notebook
- This should launch your web browser.- Create a new Python2 Notebook (by clicking in the top right)
- Run the following
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
- If everything works without an issue then run this
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radiuses
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()