Commit 3e835227 authored by Blaise Li's avatar Blaise Li

Avoid deprecation warning.

Changed .ix to .loc
parent b13393e1
...@@ -699,10 +699,10 @@ def plot_MA(res, ...@@ -699,10 +699,10 @@ def plot_MA(res,
row_indices = data.index.intersection(grouping) row_indices = data.index.intersection(grouping)
try: try:
label = f"{status} ({len(row_indices)})" label = f"{status} ({len(row_indices)})"
scatter_group(data.ix[row_indices], label, colour) scatter_group(data.loc[row_indices], label, colour)
except ValueError as err: except ValueError as err:
if str(err) != "scatter requires x column to be numeric": if str(err) != "scatter requires x column to be numeric":
print(data.ix[row_indices]) print(data.loc[row_indices])
raise raise
warnings.warn(f"Nothing to plot for {status}\n") warnings.warn(f"Nothing to plot for {status}\n")
axis.axhline(y=1, linewidth=0.5, color="0.5", linestyle="dashed") axis.axhline(y=1, linewidth=0.5, color="0.5", linestyle="dashed")
...@@ -791,12 +791,12 @@ def plot_scatter(data, ...@@ -791,12 +791,12 @@ def plot_scatter(data,
(status, colour) = group2colour (status, colour) = group2colour
row_indices = data.index.intersection(grouping) row_indices = data.index.intersection(grouping)
try: try:
data.ix[row_indices].plot.scatter( data.loc[row_indices].plot.scatter(
x=x_column, y=y_column, s=1, c=colour, x=x_column, y=y_column, s=1, c=colour,
label=f"{status} ({len(row_indices)})", ax=axis) label=f"{status} ({len(row_indices)})", ax=axis)
except ValueError as err: except ValueError as err:
if str(err) != "scatter requires x column to be numeric": if str(err) != "scatter requires x column to be numeric":
print(data.ix[row_indices]) print(data.loc[row_indices])
raise raise
warnings.warn(f"Nothing to plot for {status}\n") warnings.warn(f"Nothing to plot for {status}\n")
if axes_style is None: if axes_style is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment