Skip to content

Instantly share code, notes, and snippets.

@amrakm
Last active March 16, 2021 19:17
Show Gist options
  • Save amrakm/1c145a17e3ce5ef92f297cb7b03131a6 to your computer and use it in GitHub Desktop.
Save amrakm/1c145a17e3ce5ef92f297cb7b03131a6 to your computer and use it in GitHub Desktop.
Check if two numpy arrays are similar - useful for confirming ML implementations
## source: http://nbviewer.jupyter.org/github/rasbt/algorithms_in_ipython_notebooks/blob/master/ipython_nbs/statistics/linregr_least_squares_fit.ipynb#Sections
import numpy as np
np.testing.assert_almost_equal(arr_1, arr_2, decimal=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment