I would like to add a column to my DataFrame in which each row includes a string with the row index + 1. This is what I have attempted:
>>> import pandas as pd
>>> df = pd.DataFrame.from_records([{'some_column': 'foo'}, {'some_column': 'bar'}])
>>> df['new_column'] = f'some string {df.index + 1}'
But is just gives:
>>> df['new_column']
0 some string RangeIndex(start=1, stop=3, step=1)
1 some string RangeIndex(start=1, stop=3, step=1)
How can I achieve the desired result?