Unnecessary Iteration
Avoid unnecessary iterations. Use vectorized solutions instead of loops.
Avoid unnecessary iterations. Use vectorized solutions instead of loops.
Be careful when using the NaN equivalence comparison in NumPy and Pandas.
Avoid using chain indexing in Pandas.
Explicitly select columns and set DataType in Pandas.
When a new empty column is needed in a DataFrame in Pandas, use the NaN value in Numpy instead of using zeros or empty strings.
Explicitly specify on, how and validate parameter for df.merge() API in Pandas for better readability.
Remember to assign the result of an operation to a variable or set the in-place parameter in the API.
Use df.to_numpy() in Pandas instead of df.values() for transform a DataFrame to a NumPy array.
When the multiply operation is performed on two-dimensional matrixes, use np.matmul() instead of np.dot() in NumPy for better semantics.