PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/TestRandomDataUtils.py

https://bitbucket.org/dpollini/clove
Python | 16 lines | 12 code | 4 blank | 0 comment | 0 complexity | 087c964e1647f79400b48ed3d77eccba MD5 | raw file
  1. import clove.QuotableDataFrameUtils as QDF
  2. import clove.GeometricBrownianMotionKit as GBM
  3. import clove.RandomDataUtils as RD
  4. import pandas
  5. import unittest
  6. gbm = GBM.make(100., 0.05, 0.3, 1./52)
  7. yahoo_csv = RD.random_yahoo_data(gbm, '20050101', '20100101', 7)
  8. dataframe = QDF._csv_to_dataframe(yahoo_csv)
  9. class TestRandomData(unittest.TestCase):
  10. def test_yahoo_csv(self):
  11. self.assertEqual(dataframe.shape, (261,6))
  12. self.assertEqual(dataframe['Adj Close'].ix[0], 100.)