python merge strings in columns
df["period"] = df["Year"].astype(str) + df["quarter"]
python merge strings in columns
df["period"] = df["Year"].astype(str) + df["quarter"]
pandas add two string columns
# if both columns are strings, you can concatenate them directly
df["period"] = df["Year"] + df["quarter"]
# If one (or both) of the columns are not string typed, you should convert it
# (them) first,
df["period"] = df["Year"].astype(str) + df["quarter"]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us