Skip to content

Commit 0fa3632

Browse files
committed
Check for type before sorting
1 parent 5022aff commit 0fa3632

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
@@ -371,7 +372,11 @@ def sortAllArrays(arrsToSort, sortArrayIndex=0):
371372
"""
372373
ids = extremaSort(arrsToSort[sortArrayIndex])
373374
for i, arr in enumerate(arrsToSort):
374-
arrsToSort[i] = arr[ids]
375+
if isinstance(arr, pd.Series):
376+
arrsToSort[i] = arr.iloc[ids]
377+
else:
378+
arrsToSort[i] = arr[ids]
379+
375380
return arrsToSort
376381

377382

0 commit comments

Comments
 (0)