python merge 2 columns code example
Example 1: python show all columns
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
Example 2: python merge strings in columns
df["period"] = df["Year"].astype(str) + df["quarter"]
Example 3: bash concatenate two columns
awk 'BEGIN {FS="input_delimiter"; OFS="output_delimiter"}; {print $column# "sep" $column#}' input_file
a,series,of,comma
separated,columns,to,be
joined,together,using,the
second,and,fourth,columns
awk 'BEGIN {FS=","; OFS="\t"}; {print $2 "_" $4}' input_file
series_comma
columns_be
together_the
and_columns
Example 4: how to merge two column pandas
DataFrame["new_column"] = DataFrame["column1"] + DataFrame["column2"]