Tips & Traps¶
- Please refer to Parse TOML File in Python for general tips on parsing TOML in Python.
Installatoion¶
Replace Single Quotes With Double Quotes in Python Code
There are 2 ways.
-
Format the Python code using black, which will automatically convert single quotes to double quotes when applicable. (Note that you can format the code again using yapf if you want the code to formatted by yapf finally.)
-
Use the tool myint/unify to help you.
Inner Join of Spark DataFrames
Tips and Traps¶
Select only needed columns before joining.
Rename joining column names to be identical (if different) before joining.
Rename Rows and Columns in a pandas DataFrame
Debug Python Project in Visual Studio Code
Ways to Open a Command Palette
- Use Menu
Menu -> View -> Command Palette.... - Use the shortcut
Shift + Command + P(on macOS).

You can search for commands in the Command Palette, which makes things very convenient.
Run Tests or a Python File
- Open the Command Palette.
- Search for
Python: Runin the …
Collections and Iterators in C++
Collections
-
Prefer
std::dequetostd::vectorwhen the size of the collection is unknow. -
Suppose set
AandBare two set with the same type and setCis another set with the same value type but a different comparison function, then it is still valid to insert …