mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
Fix Pandas Warning (#4490)
* Added fix * Added fix --------- Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
@@ -269,7 +269,9 @@ def display_bw(
|
||||
start = data[target].index[0]
|
||||
|
||||
color = theme.get_colors()[0]
|
||||
x_data = data[target].index.year if yearly else data[target].index.month
|
||||
pd.options.mode.chained_assignment = None
|
||||
data["x_data"] = data[target].index.year if yearly else data[target].index.month
|
||||
pd.options.mode.chained_assignment = "warn"
|
||||
|
||||
l_months = [
|
||||
"Jan",
|
||||
@@ -292,8 +294,6 @@ def display_bw(
|
||||
xaxis_title=["Monthly", "Yearly"][yearly],
|
||||
)
|
||||
|
||||
data["x_data"] = x_data
|
||||
|
||||
for i, group in enumerate(data["x_data"].unique()):
|
||||
x = group if yearly else l_months[group - 1]
|
||||
y = data[data["x_data"] == group][target]
|
||||
|
||||
Reference in New Issue
Block a user