aboutsummaryrefslogtreecommitdiffstats
path: root/Helpers/formation_helpers.py
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2016-03-11 11:53:31 +0100
committerVolker Hoffmann <volker@cheleb.net>2016-03-11 11:53:31 +0100
commit33e5dafc7f0fdff12ad683a3a9d3b79cff4bb3c9 (patch)
treec167a29897542282d805d023f999ce76d2346e9f /Helpers/formation_helpers.py
parent4c7dbb33a38649ecb28e4b1f52f1f5222e4ccf32 (diff)
fix: new sorting in pandas >=0.17.0
Diffstat (limited to 'Helpers/formation_helpers.py')
-rw-r--r--Helpers/formation_helpers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Helpers/formation_helpers.py b/Helpers/formation_helpers.py
index 99661e8..86109ff 100644
--- a/Helpers/formation_helpers.py
+++ b/Helpers/formation_helpers.py
@@ -18,7 +18,10 @@ def return_sources(pid, dfc):
@param dfc: Collision list - [Pandas Dataframe from Io_Helpers]
@return sources: Source Particle IDs - [Numpy Array]
"""
- dfc = dfc.sort(columns="time", ascending=False)
+ if int(pd.__version__.split('.')[1]) >= 17:
+ dfc = dfc.sort_values(by='time', ascending=False)
+ else:
+ dfc = dfc.sort(columns="time", ascending=False)
sources = np.zeros(len(dfc)+1) * np.nan
sources[0] = pid
for ii, row in dfc.reset_index(drop=True).iterrows():