24 strokes nirvana do not understand this, do not say you'll Python!
Qu ink learn programming every day
First, the run-time analysis code
The first type, measure the time code to run
Ordinary method
Shortcut (jupyter environment)
The second type, a running average measure multiple codes
time
Ordinary method
Shortcut (jupyter environment)
The third type, by calling the function run-time analysis code
Ordinary method
Shortcut (jupyter environment)
A fourth type, time code to run in rows Analysis
Ordinary method
Shortcut (jupyter environment)
Second, speed up your look
5 type, rather than to find a set list
Low method
High-speed method
6 style, with matching look dict instead of two list
Low method
High-speed method
Third, speed up your circulation
Formula 7, instead preferably used for loop while loop
Low method
High-speed method
Formula 8, to avoid double counting in the loop body
Low method
High-speed method
Fourth, accelerate your function
Equation 9, instead of the recursive function by looping mechanism
Low method
High-speed method
Formula 10, the acceleration caching mechanism recursive functions
Low method
High-speed method
The first type 11, with acceleration Python function numba
Low method
image
High-speed method
Fifth, use standard library functions to accelerate
Of formula 12, using the acceleration count collections.Counter
Low method
High-speed method
Of formula 13, using the dictionary combined acceleration collections.ChainMap
Low method
High-speed method
Sixth, accelerate the use of higher-order functions
Formula 14, instead of using the map for deriving the acceleration of formula
Low method
High-speed method
Formula 15, instead of the filter used to derive the formula for acceleration
Low method
High-speed method
Seven, using numpy accelerated vectorization
Formula 16, instead of using the list np.array
Low method
High-speed method
Formula 17, instead of using np.ufunc math.func
Low method
High-speed method
Formula 18, if instead of using np.where
Low method
High-speed method
Eight, accelerate your Pandas
Formula 19, instead of using the csv file read excel file reader
Low method
High-speed method
20 type, use pandas multi-process tool pandarallel ****
Low method
High-speed method
Nine, to accelerate the use of Dask
Of formula 21, using the acceleration dask dataframe
Low method
High-speed method
Of formula 22, using accelerated dask.delayed
Low method
High-speed method
Ten, multi-threaded multi-process acceleration
23-style, multi-threaded application acceleration IO-intensive tasks
Low method
High-speed method
24 type, multi accelerate the process of CPU-intensive tasks
Low method
High-speed method