Skip to content

Commit e4a7092

Browse files
committed
Check for type before sorting
1 parent ebfcfad commit e4a7092

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/lsst/analysis/tools/actions/plot/plotUtils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import matplotlib
2828
import matplotlib.pyplot as plt
2929
import numpy as np
30+
import pandas as pd
3031
from lsst.geom import Box2D, SpherePoint, degrees
3132
from lsst.pex.config import Config, Field
3233
from matplotlib import colors
@@ -398,7 +399,11 @@ def sortAllArrays(arrsToSort, sortArrayIndex=0):
398399
"""
399400
ids = extremaSort(arrsToSort[sortArrayIndex])
400401
for i, arr in enumerate(arrsToSort):
401-
arrsToSort[i] = arr[ids]
402+
if isinstance(arr, pd.Series):
403+
arrsToSort[i] = arr.iloc[ids]
404+
else:
405+
arrsToSort[i] = arr[ids]
406+
402407
return arrsToSort
403408

404409

0 commit comments

Comments
 (0)