mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-14 05:14:19 +00:00
bugs (#1347)
This commit is contained in:
@@ -115,7 +115,10 @@ def display_valuation(
|
||||
Export data to csv,json,xlsx or png,jpg,pdf,svg file
|
||||
"""
|
||||
df_group = finviz_model.get_valuation_performance_data(s_group, "valuation")
|
||||
df_group["Market Cap"] = df_group["Market Cap"].apply(lambda x: float(x.strip("B")))
|
||||
df_group["Market Cap"] = df_group["Market Cap"].apply(
|
||||
lambda x: float(x.strip("B")) if x.endswith("B") else float(x.strip("M")) / 1000
|
||||
)
|
||||
|
||||
df_group.columns = [col.replace(" ", "") for col in df_group.columns]
|
||||
df_group = df_group.sort_values(by=sort_col, ascending=ascending)
|
||||
df_group["Volume"] = df_group["Volume"] / 1_000_000
|
||||
@@ -128,7 +131,7 @@ def display_valuation(
|
||||
title="Group Valuation Data",
|
||||
)
|
||||
|
||||
console.print("")
|
||||
console.print()
|
||||
|
||||
export_data(
|
||||
export,
|
||||
|
||||
@@ -283,6 +283,21 @@ class ETFController(BaseController):
|
||||
console.print("No company holdings found!\n")
|
||||
else:
|
||||
self.etf_holdings = holdings.index[: ns_parser.limit].tolist()
|
||||
|
||||
if "n/a" in self.etf_holdings:
|
||||
na_tix_idx = []
|
||||
for idx, item in enumerate(self.etf_holdings):
|
||||
if item == "n/a":
|
||||
na_tix_idx.append(str(idx))
|
||||
|
||||
console.print(
|
||||
f"n/a tickers found at position {','.join(na_tix_idx)}. Dropping these from holdings.\n"
|
||||
)
|
||||
|
||||
self.etf_holdings = list(
|
||||
filter(lambda x: x != "n/a", self.etf_holdings)
|
||||
)
|
||||
|
||||
console.print(
|
||||
f"Top company holdings found: {', '.join(self.etf_holdings)}\n"
|
||||
)
|
||||
|
||||
@@ -74,7 +74,7 @@ def print_rich_table(
|
||||
if show_index:
|
||||
table.add_column(index_name)
|
||||
|
||||
if headers:
|
||||
if headers is not None:
|
||||
if isinstance(headers, pd.Index):
|
||||
headers = list(headers)
|
||||
if len(headers) != len(df.columns):
|
||||
|
||||
@@ -739,10 +739,11 @@ class QaController(StockBaseController):
|
||||
type=float,
|
||||
default=99.9,
|
||||
help="""
|
||||
Percentile used for VaR calculations, for example input 99.9 equals a 99.9% VaR
|
||||
Percentile used for VaR calculations, for example input 99.9 equals a 99.9 Percent VaR
|
||||
""",
|
||||
)
|
||||
|
||||
print(parser)
|
||||
print(other_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, other_args)
|
||||
if ns_parser:
|
||||
qa_view.display_var(
|
||||
|
||||
Reference in New Issue
Block a user