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…

Data types, indexing, and slicing

In this article, I would like to briefly review the native data types in Python, comparing with those well-known data types provided by libraries, e.g., NumPy and Pandas, and focus on their essential usages. List of common data types in Python: bool int、float、complex string list tuple dict set bool int, float, and complex These are…

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…