def get_volume(): code = '600874' df = ts.get_hist_data(code=code, start='2017-01-01') vol = df['ma20'] print vol