Fix Pandas Warning (#4490)

* Added fix

* Added fix

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
Colin Delahunty
2023-03-15 09:25:50 -04:00
committed by GitHub
parent 46fcf9c950
commit 8bd7606120

View File

@@ -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]