Skip to content

Instantly share code, notes, and snippets.

@PhanDuc
Last active July 24, 2017 10:57
Show Gist options
  • Save PhanDuc/a73c450c0f91932ecab00863b1fb108a to your computer and use it in GitHub Desktop.
Save PhanDuc/a73c450c0f91932ecab00863b1fb108a to your computer and use it in GitHub Desktop.
DF add column
import pandas as pd
df = pd.read_excel('D:\\BILL THÁNG 1.xlsx')
du = df.ix[:, 4]
temp_list = []
for cell in du:
try:
ed = ''.join(cell.split(',')[-1])
print(ed)
temp_list.append(ed)
except:
temp_list.append(cell)
#df['er'] = ed
df['er'] = temp_list
df.to_excel('P:\\DataKH.xlsx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment