我有一个已保存的Excel工作表(例如:WeeklyReport1)。我想通过提取cell1 =“ product name”和cell2 =“ Channel name” >>>中的值来保存它,因此结果将是:WeeklyReport1ProductnameChannelname。我是Python新手,这让我很烦
我做了什么:
import pandas as pd
df = pd.read_excel(r'C:\Users\ANMAM9\Desktop\19216\AgencyRankingReportWeekly1.xls','Sheet2')
就是这样:(
答案 0 :(得分:1)
Import pandas as pd
df=pd.read_csv(“path_to_file/file.csv”)``
df=[[“product_name”,”channel_name”]]
df.to_csv(“path/new_name.csv”)