def test_pandas(self): import pandas as pd # result = findStockByCode('600327') result = find_week52_history(self.code) logger.debug(result) df = pd.DataFrame(list(result)) logger.debug(df) logger.debug(df.shape) logger.debug(df['low'].min()) logger.debug(df['low'].argmin()) logger.debug(df['high'].max()) high_week52_index = df['high'].argmax() low_week52_index = df['low'].argmin() logger.debug(high_week52_index) logger.debug(df[['date','high']][high_week52_index:high_week52_index+1]) logger.debug(df[['date','low']][low_week52_index:low_week52_index+1])
def test_pandas(self): import pandas as pd # result = findStockByCode('600327') result = find_week52_history(self.code) logger.debug(result) df = pd.DataFrame(list(result)) logger.debug(df) logger.debug(df.shape) logger.debug(df['low'].min()) logger.debug(df['low'].argmin()) logger.debug(df['high'].max()) high_week52_index = df['high'].argmax() low_week52_index = df['low'].argmin() logger.debug(high_week52_index) logger.debug(df[['date', 'high']][high_week52_index:high_week52_index + 1]) logger.debug(df[['date', 'low']][low_week52_index:low_week52_index + 1])
def test_week52(self): history = find_week52_history(self.code) logger.debug(history) logger.debug(history.count())