import pandas as pd
定义一个获取新列数据的方法
def get_new_col(input)
str1 =f“我是{input}”
return str1
file_name=“文件路径写在这里”
根据列a新增一列new_column
df=pd.read_excel(file_name)
df[“new_column”]=df[“列a”].apply(get_new_col)
保存文件(输出不显示index 索引值
df.to_excel(“result.xlsx, index=False)