'Concatenat two column of an existing excel file in python?
I'm trying to concatenate two columns from an existing Excel file that has multiple sheets inside, using Python.
I already started with importing the file to "jupyter" with this code down below and it worked, but i am stuck in this next step.
import xlrd
import pandas as pd
df = pd.read_excel (r'C:\Users\zahir\Desktop\Stage\BDD_Cells_2G+3G+4G_01072019.xlsx')
print(df)
Solution 1:[1]
The column headers are unknown, given the information provided in your question. Not knowing, I would start here:
column_header_1='ch1'
column_header_2='ch2'
column_header_3='ch3'
df['newColumn3']= df[column_header_1].map(str)+df[column_header_2].map(str)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | McDonalds Happy Meal |
