Fix Pandas Warning (#1250)

* Fixed Pandas wanring issue

* Adjusted warning mute
This commit is contained in:
Colin Delahunty
2022-01-23 16:47:01 -05:00
committed by GitHub
parent 57c0f840ac
commit b9f7b09dcd
2 changed files with 3 additions and 3 deletions

View File

@@ -96,6 +96,7 @@ def add_order_total(df_orders: DataFrame) -> DataFrame:
for i, candle in enumerate(["Volume", "Open", "Close", "High", "Low", "Total"]):
df_orders.insert(i + 3, candle.lower(), 0)
pd.options.mode.chained_assignment = None
for i, _ in df_orders.iterrows():
if np.isnan(
prices["Open"][df_orders.loc[i, "ticker"]][
@@ -115,4 +116,6 @@ def add_order_total(df_orders: DataFrame) -> DataFrame:
df_orders.loc[i, "close"] * df_orders.loc[i, "shares"]
)
pd.options.mode.chained_assignment = "warn"
return df_orders

View File

@@ -2,7 +2,6 @@
__docformat__ = "numpy"
import os
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.helper_funcs import export_data, rich_table_from_df
from gamestonk_terminal.stocks.discovery import ark_model
@@ -72,8 +71,6 @@ def ark_orders_view(
if gtff.USE_COLOR:
df_orders["direction"] = df_orders["direction"].apply(direction_color_red_green)
# df_orders["link"] = "https://finviz.com/quote.ashx?t=" + df_orders["ticker"]
rich_table_from_df(
df_orders,
headers=[x.title() for x in df_orders.columns],