def testEmptyTailDFReturnsTailDataFame(self): stocksData ={ } npsy = NumpySciPy() df = npsy.initDataFrame(stocksData) actual = npsy.tailDF(df) expected = pd.DataFrame(stocksData).tail()
def testDefaul10TailDFReturnsTailDataFame(self): stocksData = { "Blackstone": [49.56, 50.70, 51.18, 52.80, 52.87,24.24, 24.60, 26.04, 26.90, 26.66], "KKR": [24.24, 24.60, 26.04, 26.90, 26.66,24.24, 24.60, 26.04, 26.90, 26.66] } dates = ['5/4/20', '5/5/20', '5/6/20', '5/8/20', '5/9/20','5/4/20', '5/5/20', '5/6/20', '5/8/20', '5/9/20'] npsy = NumpySciPy() df = npsy.initDataFrame(stocksData, rows=dates) actual = npsy.tailDF(df,) expected = pd.DataFrame(stocksData, index=dates).tail(10)