With sed, I can do
$ sed 's/^/prefix/' <<EOF
> foo
> EOF
prefixfoo
When I use pandas.Series.str.replace, the regex does not work. The minimal working example
import pandas as pd
df = pd.DataFrame({"text": ["foo", "bar"]})
df.text.str.replace("^", "prefix", regex=True)
returns
0 foo
1 bar
Name: text, dtype: object