Python

Object Oriented Programming in Python and

2022-05-04

Sorting

Python provides two built-in functions for sorting: list.sort(): modifies the list in-place sorted(): builds a new sorted list from an iterable Difference between these methods: list.sort() method is only defined for lists.

2022-05-02

Serialization

2022-05-01

Files

2022-05-01

Data Structures and Collections

2022-05-01

String

In-depth look at the Python built-in handling for strings.

2022-05-01

Basic Input and Output

Source: RealPython Reading Input From the Keyboard input([<prompt>]): Reads a line from the keyboard. (Documentation) pauses program execution to allow the user to type in a line of input from the keyboard

2022-04-28

Matplotlib Issues

Just to mark down some issues I have met when using matplotlib.pyplot for plotting. Change global font to Times New Roman import matplotlib.pyplot as plt plt.rcParams['font.family'] = 'DeJavu Serif' plt.rcParams['font.serif'] = ['Times New Roman'] Source: Matplotlib cannot find basic fonts

2022-01-23

pre-commit

TL;DR Before committing any staged Python files, pre-commit automatically formats the code, validates compliance to PEP8, and performs different types of checking to keep the code and the project clean. This automatical process can greatly save our time on code formatting so that we can concentrate on code logic.

2021-11-01

pathlib

Why patblib? The pathlib module, introduced in Python 3.4 (PEP 428), gathers the necessary functionality in one place and makes it available through methods and properties on an easy-to-use Path object.

2020-12-26