Exemplo n.º 1
0
def worth_at_date_czk(transaction_file, date):
    return worth_at_date(transaction_file, date).apply(lambda x: x * cv.getUSDPair(date, 'czk'), axis=1)
Exemplo n.º 2
0
def worth_at_date(transaction_file, date):
    df = read_file(transaction_file)
    qs = df[df.dt_date <= date].groupby(['owner', 'ticker', 'quoted_in']).quantity.sum()
    return pd.DataFrame(qs).apply(lambda x: cv.close_price_from(date, x.name[1]) * x.quantity * cv.getUSDPair(date, x.name[2]),
                                  axis=1).reset_index().groupby('owner').sum()