def get_market_fundamental_by_ticker(date, market="ALL"): if isinstance(date, datetime.datetime): date = _datetime2string(date) df = krx.get_market_fundamental_by_ticker(date, market) if not df.empty: df['PBR'] = df['PER'] * df['EPS'] / df['BPS'] df.loc[df['BPS'] == 0, 'PBR'] = 0 return df
def get_market_fundamental_by_ticker(date, market="ALL"): df = krx.get_market_fundamental_by_ticker(date, market) if not df.empty: df['PBR'] = df['PER'] * df['EPS'] / df['BPS'] df.loc[df['BPS'] == 0, 'PBR'] = 0 return df