#Testing your data with asserts
'''
Here, you'll practice writing assert statements using the Ebola dataset from previous chapters to programmatically check for missing values and to confirm that all values are positive. The dataset has been pre-loaded into a DataFrame called ebola.

In the video, you saw Dan use the .all() method together with the .notnull() DataFrame method to check for missing values in a column. The .all() method returns True if all values are True. When used on a DataFrame, it returns a Series of Booleans - one for each column in the DataFrame. So if you are using it on a DataFrame, like in this exercise, you need to chain another .all() method so that you return only one True or False value. When using these within an assert statement, nothing will be returned if the assert statement is true: This is how you can confirm that the data you are checking are valid.

Note: You can use pd.notnull(df) as an alternative to df.notnull().

Instructions
100 XP
Write an assert statement to confirm that there are no missing values in ebola.
Use the pd.notnull() function on ebola (or the .notnull() method of ebola) and chain two .all() methods (that is, .all().all()). The first .all() method will return a True or False for each column, while the second .all() method will return a single True or False.
Write an assert statement to confirm that all values in ebola are greater than or equal to 0.
Chain two all() methods to the Boolean condition (ebola >= 0).
'''

# Code
# Assert that there are no missing values
assert pd.notnull(ebola).all().all()

# Assert that all values are >= 0
assert (ebola >= 0).all().all()


'''my note
In [2]: pd.notnull(ebola).all()
Out[2]: 
Date                   True
Day                    True
Cases_Guinea           True
Cases_Liberia          True
Cases_SierraLeone      True
Cases_Nigeria          True
Cases_Senegal          True
Cases_UnitedStates     True
Cases_Spain            True
Cases_Mali             True
Deaths_Guinea          True
Deaths_Liberia         True
Deaths_SierraLeone     True
Deaths_Nigeria         True
Deaths_Senegal         True
Deaths_UnitedStates    True
Deaths_Spain           True
Deaths_Mali            True
dtype: bool

In [3]: pd.notnull(ebola).all().all()
Out[3]: True


'''