16 lines
526 B
Python
16 lines
526 B
Python
import pymysql,pandas,sys,re
|
|
|
|
def cleanTxt(txt):
|
|
res = re.sub("\t|\n", " ", txt)
|
|
res = re.sub("\:{2,3}|\:+$", "", res)
|
|
res = re.sub("\:\,", ",", res)
|
|
return res
|
|
|
|
df = pandas.read_excel("/Users/maddiekorea/PycharmProjects/prdKwdBuilder/po_keywords.xlsx")
|
|
|
|
df = df.fillna("")
|
|
df['options'] = df['options'].apply(cleanTxt)
|
|
df['po_context'] = df['po_context'].apply(cleanTxt)
|
|
df['mrkt_titl_nm'] = df['mrkt_titl_nm'].apply(cleanTxt)
|
|
|
|
df.to_excel("/Users/maddiekorea/PycharmProjects/prdKwdBuilder/po_keywords_.xlsx") |