def test(self): self.assertEqual(average.ave([2,2,2]),2)
def __init__(self, parlor_id, date): self.strdate = date self.parlor_id = parlor_id self.df = pd.read_csv('../data/{}.{}.csv'.format(parlor_id, date), index_col=[0, 1]) self.average = ave(self.df, date)
# Python019 #Author: Jingxiong Wu #May/08/2018 #Python exercise project 19 ''' modules example''' import average data = [1, 3, 4, 5, 6, 8, 11, 16] average.ave(*data)
def __init__(self, parlor_id, m_ids): self.strdate = pd.to_datetime('today').strftime("%Y%m%d") self.parlor_id = parlor_id self.df = api(parlor_id, m_ids) self.average = ave(self.df)