Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_percentile_cutoff_top_p(self):
expected = self.df.loc[:, ['B', 'C']]
result = msno.nullity_filter(self.df, p=0.6, filter='top')
assert result.equals(expected)
def test_combined_cutoff_top(self):
expected = self.df.loc[:, ['C']]
result = msno.nullity_filter(self.df, n=2, p=0.7, filter='top')
assert result.equals(expected)
def test_percentile_cutoff_bottom_n(self):
expected = self.df.loc[:, ['C']]
result = msno.nullity_filter(self.df, n=1, filter='top')
assert result.equals(expected)
def test_no_op(self):
assert self.df.equals(msno.nullity_filter(self.df))
assert self.df.equals(msno.nullity_filter(self.df, filter='top'))
assert self.df.equals(msno.nullity_filter(self.df, filter='bottom'))
def test_percentile_cutoff_top_n(self):
expected = self.df.loc[:, ['A']]
result = msno.nullity_filter(self.df, n=1, filter='bottom')
assert result.equals(expected)
def test_combined_cutoff_bottom(self):
expected = self.df.loc[:, ['A']]
result = msno.nullity_filter(self.df, n=2, p=0.4, filter='bottom')
assert result.equals(expected)
def test_percentile_cutoff_bottom_p(self):
expected = self.df.loc[:, ['A']]
result = msno.nullity_filter(self.df, p=0.6, filter='bottom')
assert result.equals(expected)
def test_no_op(self):
assert self.df.equals(msno.nullity_filter(self.df))
assert self.df.equals(msno.nullity_filter(self.df, filter='top'))
assert self.df.equals(msno.nullity_filter(self.df, filter='bottom'))