I have a dataframe like this:
Basic Stats Min Max Mean Stdev Num Eigenvalue
0 Band 1 0.428944 0.843916 0.689923 0.052534 1 0.229509
1 Band 10 -0.000000 0.689320 0.513170 0.048885 2 0.119217
And I want to replace Band 1 with LG68 and Band 10 with LG69
I have tried:
df=df.replace({'Band 1': 'LG68', 'Band 10': 'LG69'}, regex=True)
but this returns:
Basic Stats Min Max Mean Stdev Num Eigenvalue
0 LG68 0.428944 0.843916 0.689923 0.052534 1 0.229509
1 LG680 -0.000000 0.689320 0.513170 0.048885 2 0.119217
because Band 10 also contains Band 1 within it.
I have also tried:
df=df.T
df=df.rename(columns={'Band 1':'LG68', 'Band10': 'LG69'})
but this fails silently (no names change at all), possibly because I don't have Band 1 and Band 10 as column names but are instead actual rows?