I am following this answer with 88 upvotes but it doesn't work anymore:
>>> df = pd.DataFrame(
[['USA', 'Nevada', 'Las Vegas'],
['Brazil', 'Pernambuco', 'Recife']],
columns=['Country', 'State', 'City']
)
df['AllTogether'] = df['Country'].str.cat(df[['State', 'City']], sep=' - ')
I get the error:
raise ValueError("Did you mean to supply a `sep` keyword?")
ValueError: Did you mean to supply a `sep` keyword?
Not sure what has changed since the posted answer.
I have pandas version of 0.22.0
. I can't update the version due to test reasons.
Edit: I am not looking for alternate answer but the concern is about the error.