-1

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)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Hi, you should provide a [minimum reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). Also, this question has [already been asked in a more general form](https://stackoverflow.com/questions/19377969/combine-two-columns-of-text-in-dataframe-in-pandas-python). An even better resource is the `pandas` [documentation](https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html). – skurp Jul 25 '19 at 16:11

1 Answers1

0

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)