numpy-100
numpy-100 copied to clipboard
alternative solution for Q.83 & Q.84
Q.83
: The np.bincount
only counts non-negative ints according to its docs, which is not very useful in the dirty dataset. It can be optimized with np.unique(data, return_counts=True)
, which returns the unique values and corresponding count.
Q.84
: sliding_window_view
is a more readable function.