From 2bc400b9f57c13becf347284521b143808f7cd59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr> Date: Mon, 16 May 2022 12:21:27 +0200 Subject: [PATCH] Added guard to sort_values in orderRenameTable if no sort key --- data/tableDisplay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/tableDisplay.py b/data/tableDisplay.py index 9d09aa5..839f681 100644 --- a/data/tableDisplay.py +++ b/data/tableDisplay.py @@ -115,7 +115,8 @@ def orderRenameTable( df, indexDict ): df.index.names = indexNames df.rename( dict( colDict ), axis='columns', inplace=True ) # Sort the rows (by index column order) - df = df.sort_values( by = sortIndex ) + if ( len(sortIndex) > 0 ): + df = df.sort_values( by = sortIndex ) return df ### FORMATTING -- GitLab