I have this table, weather_tb, where some values are misplaced into other columns. I want to move those values into their matching columns.
showing what values need to be moved
The value is not being set in the respective position in the Ta column and is not removed from the original column. what am I missing?
import re  # regex 
for i in (6, 12, 23, 34, 45, 56):  # rows with misplaced data
  for j in range(1, 19):  # columns in range
    if weather_tb.iloc[i][j] == None:
        continue  # testing if cell is a null value to skip
    if re.match("Ta=\d\.?\d+.*", weather_tb.iloc[i][j]) and j != 7:  # testing if there is a match for Ta and it's not on the Ta column
      x = re.search("Ta=\d\.?\d+.*", weather_tb.iloc[i][j])  # assigning the findings to x
      weather_tb.iloc[i][7] = x.group()  # writing the value in Ta column
      print(weather_tb.iloc[i][7])  # printing to verify .. it's showing none which is not expected 
      print(x.group())             # showing the found values no problem
      weather_tb.iloc[i][j] = None  # removing the value from the wrong cell ( current cell)
The value is not being set in the respective position in the Ta column and is not removed from the original column. what am I missing?
timestamp   Dn  Dm  Dx  Sn  Sm  Sx  Ta  Ua  Pa  ...     Rd  Ri  Hc  Ha  Hd  Hi  Vs  Vr  Th  R_type
0   1676907187  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
1   1676907188  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
2   1676907189  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
3   1676907190  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
4   1676907191  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
5   1676907192  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
6   1676907192  Th=11.5C    Vh=24.8V    Vs=25.2V    Vr=3.641V\n\r   None    None    None    None    None    ...     None    None    None    None    None    None    None    None    None    R5
7   1676907193  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
8   1676907194  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
9   1676907194  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#     Ta=10.0C    Ua=44.7P    Pa=886.9H   ...     Rd=23580s   Ri=0.0M     Hc=0.0M     Hd=30s  Hi=0.0M     Vs=25.2V    Vr=3.641V\n\r   None    None    R0
10  1676907195  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
11  1676907196  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
12  1676907196  Ta=10.0C    Ua=44.7P    Pa=886.9H\n\r   None    None    None    None    None    None    ...     None    None    None    None    None    None    None    None    None    R2
13  1676907197  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
14  1676907198  Dn=000#     Dm=000#     Dx=000#     Sn=0.0#     Sm=99.9#    Sx=0.0#\n\r     None    None    None    ...     None    None    None    None    None    None    None    None    None    R1
 
     
    