The goal is to pull a list of securities and their fundamentals information normally, and also fundamental info on sets of securities that one would specify by their symbols, where they would be independent from the filters.
Is an 'OR' available?
Generic example calling twice:
f = fundamentals
panel1 = get_fundamentals( # Fundamentals by filter
query(
f.valuation_ratios.pe_ratio,
)
.filter(f.share_class_reference.is_primary_share == True)
.order_by(f.valuation.market_cap.desc())
.limit(20)
)
panel2 = get_fundamentals( # Fundamentals for specific symbols
query(
f.valuation_ratios.pe_ratio,
)
.filter(f.company_reference.primary_symbol.in_(['AAPL', 'TSLA']))
.order_by(f.valuation.market_cap.desc())
)
panel3 = pd.concat([panel1, panel2], axis=1)
... however the concat failed with:
"Runtime exception: TypeError: cannot concatenate a non-NDFrame object"
In get_fundamentals help, the return is said to be a pandas.Panel rather than a DataFrame.
So I'm wondering if this can be done in one call with an 'OR' inside get_fundamentals or whether the two panels can be combined.
Thanks
PS Tip: For those who did not know, the query() section populates the panel with specific values. If only the filters and ordering are being utilized, for the resulting securities list, then query() can be empty, that's faster.