Pandas DataFrames with NaNs equality comparison

You can use assert_frame_equals with check_names=False (so as not to check the index/columns names), which will raise if they are not equal: In [11]: from pandas.testing import assert_frame_equal In [12]: assert_frame_equal(df, expected, check_names=False) You can wrap this in a function with something like: try: assert_frame_equal(df, expected, check_names=False) return True except AssertionError: return False In more … Read more

classifiers in scikit-learn that handle nan/null

Short answer Sometimes missing values are simply not applicable. Imputing them is meaningless. In these cases you should use a model that can handle missing values. Scitkit-learn’s models cannot handle missing values. XGBoost can. More on scikit-learn and XGBoost As mentioned in this article, scikit-learn’s decision trees and KNN algorithms are not (yet) robust enough … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)