Notes of using Python for Data Analytics

Chapter 0: Foundations of Python Basic syntax Data types, indexing, and slicing Flow control and looping Functions Object-oriented programming List comprehensions Regular expression Data input and output Basic text files Excel Database Chapter 1: Essential libraries Numpy Pandas Basic data visualization Scatter Plots Histograms Cumulative Frequencies Error-bars Box plots Pie Charts Chapter 2: Statistics brief…

Some Jupyter editing tips

Block indent/unindent : Shift / Tab + Shift Multi-lines comments : Ctrl + / Undo text entry in Cell: Ctrl + Z IPython Magic Commands %matplotlib inline: this will shows plots in notebook directly

Embed a snapshot from your Gist

本來在Gist的網址是 將帳號從網址中除去後即可直接貼上wordpress的new post完成snapshot embed Sorry, something went wrong. Reload? Sorry, we cannot display this file. Sorry, this file is invalid so it cannot be displayed. Viewer requires iframe. view raw KMean_Version3.ipynb hosted with ❤ by GitHub

Python- user-defined Functions

In order to organize your code with some repeating requirements, calling functions can be quite efficiently. Other than those built-in function, you can also create your own user-defined functions. The basic syntax of Function is:

Python: Flow control and looping

If…else statement can be found in most mainstream programming languages to control the flow of your program’s execution. With your predescribed conditions, your program is capable of handling different circumstances by corresponding treatment. The basic syntax is: if condition_expression: statement(s) elif condition_expression: statement(s) else: statement(s) Both elif and else are optional and mul tiple elif is…