Python is a Programming Language
Why Python is so popular?
If you only minimum time to learn only one new programming lanugage, Python would be your best choice.
|Major Category||Minor Category||RQ||Method||Application|
|Supervised Learning||Regression||What is the score of A?||Pearson Regression
KNN, Neural Network
|Stock price prediction
|Supervised Learning||Classification||Which category does A belong to?||Naive Bayesian, KNN
|Unsupervised Learning||Clustering||How many clusters are there?||KMeans,Gaussian Mixtures
|Unsupervised Learning||Dimension Reduction||How many dimensions are sufficient
to represent data variance?
|Image Recognition||Clustering based on PCA|
Identifying meaningful research questions is an important capacity, which requires comprehensive tacit knowledge on top of explicit knowledge. In this workshop series, we can only learn explicit knowledge like know-what and know-how. And to cultivate the capicity of identifying RQs, you need to practice more in your spare time to help internalize and transform explicit knowledge into tacit one.
Python 3.X is recommended. The number following "Python", i.e. 3.X, is the 'version number', which is composed of generation number and minor version number. The greater number, the more updated.
After 11 years' development, Python 3 has become very mature and stable. Almost all libraries and packages are supporting Python 3.X. And some important libraries, like TensorFlow, are exclusive to Python 3.X users.
Open Command Line Interface (CLI)
CLI is an interface allowing you to write textual instructions line by line to control computer do something at your command.
_There are several CLIs available in Mac OS and Windows._
Terminal(built-in CLI): Spotlight Search/Launchpad -> Type "Terminal" -> Type "py3
IDLE(python-specific CLI): Spotlight Search/Launchpad -> Type "IDLE"
PowerShell(built-in CLI): Start Menu -> Type "PowerShell" -> Type "py"
Command Prompt(built-in CLI):Start Menu -> Type "Command Prompt" -> Type "py"
Python Command Line(python-specific CLI): Start Menu -> Type "Python" -> Choose "Python (Command Line)"
PowerShell: Windows+R -> Type "powershell"
Command Prompt:Windows+R -> Type "cmd"
Mac OS IDLE:
_number inside red box is the **version number**_
Mac OS Terminal:
_string inside the blue box indicates **current directory**_
Windows Command Prompt:
is0 or 1
is not0 or 1
>0) and (1
>0) or (1
notTrue, not (1
=1, here "a" is the variable name and 1 is its value.
=a + 1 or a
=a - 1 or a
cd [folder name]to a child folder of current folder or any folder with absolute directory path
cd..to navigate to the parent folder of current folder
Generally speaking, every operating system has equipped with Linux-like **built-in CLIs** by default. They can be instantly switched to Python environment by simply one command, i.e. "py" or "py3".
Besides, a **Python-specific CLI** is provided after installation. You could find it by searching its name in Start Menu or Spotlight. Different from built-in CLIs, it is running under python environment by default so it doesn't require extra command to turn into this way.
However, the biggest weakness of CLIs is that you can only write commands **line by line**, which is inefficient and even disruptive to integrative thinking. To overcome this, we will introduce two alternatives to CLIs, namely **Jupyter Notebook** and **Sublime Text (optional)**.
Other than CLIs, we can choose to use external softwares to run Python environment.
Here we will first learn an interactive python editor called **Jupyter Notebook**, which has been widely adopted as a norm in Silicon Valley.
pip3 install [library name]in system built-in CLIs (Terminal/PowerShell/Command Prompt).
pip3 install jupyter
Selenium: pip3 install selenium
Pandas: pip3 install pandas
Numpy: pip3 install numpy
Sciki-learn: pip3 install sklearn
Plot.ly: pip3 install plotly
To help you better grasp the knowledge, I will prepare assignment for you every week. Assignments will be mindfully designed to make sure average people can finish it within two hours. You are suggested to finish them before next class, but it's not compulsory. I will grade them, send you my feedback comments and organize some discussions at the beginning of every class. May you have any question, feel free to find me (firstname.lastname@example.org).
Course code: k8mi2l