20 | def none_missing(df, columns=None): |
21 | """ |
22 | Asserts that there are no missing values (NaNs) in the DataFrame. |
23 | |
24 | Parameters |
25 | ---------- |
26 | df : DataFrame |
27 | columns : list |
28 | list of columns to restrict the check to |
29 | |
30 | Returns |
31 | ------- |
32 | df : DataFrame |
33 | same as the original |
34 | """ |
35 | if columns is None: |
36 | columns = df.columns |
37 | try: |
38 | assert not df[columns].isnull().any().any() |
39 | except AssertionError as e: |
40 | missing = df[columns].isnull() |
41 | msg = generic.bad_locations(missing) |
42 | e.args = msg |
43 | raise |
44 | return df |