From 94d7923ced409c2aced819d595aab3f1cca876df Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Wed, 17 Jul 2024 17:25:20 +0200 Subject: [PATCH] python: inet.scave.plot: eliminate FutureWarning: ChainedAssignmentError --- python/inet/scave/plot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/inet/scave/plot.py b/python/inet/scave/plot.py index 403f0caac4a..3b008dcbfdc 100644 --- a/python/inet/scave/plot.py +++ b/python/inet/scave/plot.py @@ -700,8 +700,8 @@ def remove_zero_index_if_present(df): for i in range(0,len(df)): pattern = re.compile(value) - logger.debug(f"value: {value}, pattern: {pattern}, df[column][i] {df[column][i]}") - match = re.fullmatch(pattern, df[column][i]) + logger.debug(f"value: {value}, pattern: {pattern}, df.loc[i, column] {df.loc[i, column]}") + match = re.fullmatch(pattern, df.loc[i, column]) logger.debug(f"match: {match}") if match != None: # if debug: @@ -732,9 +732,9 @@ def remove_zero_index_if_present(df): logger.debug(f'order_column: {order_column}, order_dict {order_dict}') for i in order_dict.items(): for j in range(0,len(df)): - # if df[order_column][j] == i[0]: + # if df.loc[j, order_column] == i[0]: pattern = re.compile(i[0]) - match = re.fullmatch(pattern, df[order_column][j]) + match = re.fullmatch(pattern, df.loc[j, order_column]) if match != None: df.loc[j, 'order'] = i[1] else: @@ -743,9 +743,9 @@ def remove_zero_index_if_present(df): logger.debug(f'order_column: {order_column}, order_list {order_list}') for order in range(0, len(order_list)): for j in range(0,len(df)): - # if df[order_column][j] == i[0]: + # if df.loc[j, order_column] == i[0]: pattern = re.compile(order_list[order]) - match = re.fullmatch(pattern, df[order_column][j]) + match = re.fullmatch(pattern, df.loc[j, order_column]) if match != None: df.loc[j, 'order'] = order