Skip to content

Commit

Permalink
python: inet.scave.plot: eliminate FutureWarning: ChainedAssignmentError
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgeorge309 committed Jul 17, 2024
1 parent 201cbfb commit 94d7923
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/inet/scave/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 94d7923

Please sign in to comment.