The NumPy where function is like a vectorized switch that you can use to combine two arrays.
You can find the mode of an empirical continuous distribution by plotting the histogram and looking for the maximum bin.
The np.all() function tests whether all elements in a NumPy array evaluate to true.
A simple NumPy implementation of the binary cross entropy loss function and some intuition about why it works.
Pandas provides a .query() method on DataFrame’s with a convenient string syntax for filtering DataFrames. This post describes the method and gives simple usage examples.
PyTorch has a one_hot() function for converting class indices to one-hot encoded targets.