Ejemplo n.º 1
0
 def test_separate_quantiles(self):
     df = self.df.copy()
     df.iloc[10, 0] = 99
     p = [(0, .99), (.01, 1)]
     kept_index = [x for x in df.index if x not in [1, 10]]
     expected = df.iloc[kept_index, :]
     result = winsorize(df, ('x', 'y'), p=p)
     assert_frame_equal(expected, result)
Ejemplo n.º 2
0
 def test_twovar(self):
     expected = self.df.iloc[2:-1, :]
     result = winsorize(self.df, ('x', 'y'))
     assert_frame_equal(expected, result)
Ejemplo n.º 3
0
 def test_onesided(self):
     expected = self.df.iloc[:-1, :]
     result = winsorize(self.df, 'x', p=(0, .95))
     print(expected)
     print(result)
     assert_frame_equal(expected, result)
Ejemplo n.º 4
0
 def test_onevar(self):
     expected = self.df.iloc[2:, :]
     result = winsorize(self.df, 'y')
     assert_frame_equal(expected, result)