pandas dataframe add two columns int and string
df1 = df['1st Column Name'].map(str) + df['2nd Column Name'].map(str) + ...
pandas dataframe add two columns int and string
df1 = df['1st Column Name'].map(str) + df['2nd Column Name'].map(str) + ...
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