Esempio n. 1
0
 def test_data_frame(self):
     df = pd.DataFrame({
         'IBM':
         pd.Series([np.NaN, 1.5, 2.5, np.NaN],
                   index=['1/1/13', '2/1/13', '3/1/13', '4/1/13']),
         'MSFT':
         pd.Series([np.NaN, 1.0, 1.5, 5],
                   index=['1/1/13', '2/1/13', '3/1/13', '4/1/13'])
     })
     np.testing.assert_array_equal(df, qp.sma(self.data_frame, 2))
Esempio n. 2
0
 def test_data_frame(self):
     df = pd.DataFrame({
         'IBM': pd.Series(
             [np.NaN, 1.5, 2.5, np.NaN],
             index=['1/1/13', '2/1/13', '3/1/13', '4/1/13']
         ),
         'MSFT': pd.Series(
             [np.NaN, 1.0, 1.5, 5],
             index=['1/1/13', '2/1/13', '3/1/13', '4/1/13']
         )
     })
     np.testing.assert_array_equal(df, qp.sma(self.data_frame, 2))
Esempio n. 3
0
 def test_data(self):
     np.testing.assert_array_equal(
         pd.Series((np.NaN, np.NaN, 11.0, 12.0, 13.0, 14.0)),
         qp.sma(self.series, 3))
Esempio n. 4
0
 def test_data(self):
     np.testing.assert_array_equal(
         pd.Series((np.NaN, np.NaN, 11.0, 12.0, 13.0, 14.0)),
         qp.sma(self.series, 3)
     )