目前坚持使用具有 10lac 行的 .csv 文件。我正在将数据集加载到名为 rawdata的数据框架Python中。该文件具有 ascii 代码,可能是因为它拍摄了错误'utf-8' codec can't decode byte 0x99 in position 21: invalid start byte 这个解决方案在任何地方都没有正确提及。在此处输入代码
将 numpy 作为 np 导入 pandas 作为 pd 将 scipy 作为 sci 导入
导入 sys 重载(sys) sys.setdefaultencoding(“ISO-8859-1”)
导入操作系统打印 os.getcwd()
os.chdir('D:\DJ\展示位置报告\')
setwd()
rawdata=pd.read_csv('D:\DJ\Placement reports\Copy of Placement Reports _ Apr_Mar_May Page 2.csv', newline='', encoding='utf-8')
rawdata=pd.read_csv("D:\DJ\Placement reports\Copy of Placement Reports _ Apr_Mar_May Page 1.csv")
rawdata=pd.read_csv("D:\DJ\Pyhton analysis\wagering.csv")
a.encode('utf-8').strip()
x = pd.read_csv("D:\DJ\Placement reports\Test1.csv")
open('D:\DJ\Placement reports\Copy of Placement Reports _ Apr_Mar_May Page 2.csv', newline='', encoding='utf-8')
数据框 :: Month Placement Placement URL Type Campaign Ad group Clicks Impr. 点击率平均 CPC 成本 Apr-18 移动应用程序:Cric Informer(Dream11,Myteam11 Tips & IPL NEWS)(Google Play),BRAJ & GEETA INC https://play.google.com/store/apps/details?id=manager.attendance .fantasycrickettips移动应用程序 Display-Affinity-Keyword-Topics Display_Keywords 52,584 61,07,340 0.86% ? 1.76 ? 92,484.03 Mar-18 移动应用:NewsDog - 最新消息、突发新闻、本地新闻 (Google Play),由 NewsDog 团队提供https://play.google.com/store/apps/details?id=com.newsdog 移动应用显示-亲和力-关键字-主题 Audience_Affinity 99,361 58,55,703 1.70% ? 0.82 ? 81,644.29 Apr-18 移动应用程序:Cric Informer(Dream11,Myteam11 Tips & IPL NEWS)(Google Play),BRAJ & GEETA INC https://play.google.com/store/apps/details?id=manager.attendance。 Fantasycrickettips移动应用程序 Display-Custom-Intent-India Custom-Intent 28,106 43,14,179 0.65% ? 2.85 ? 79,991.28 Apr-18 移动应用程序:Cric Informer(Dream11,Myteam11 Tips & IPL NEWS)(Google Play),BRAJ & GEETA INC https://play.google.com/store/apps/details?id=manager.attendance。 Fantasycrickettips移动应用程序 Display-Affinity-Keyword-Topics Audience_Affinity 39,526 39,54,727 1.00% ? 1.79 ? 70,662.24 Apr-18 us.com http://us.com 网站显示-亲和力-关键字-主题 Audience_Affinity 23,792 60,06,433 0.40% ? 2.83 ? 67,301.35 Mar-18 移动应用程序:GiftMoney (Google Play),KingToUpper https://play.google.com/store/apps/details?id=com.akp151998.giftmoney 移动应用程序 Display-Affinity-Keyword-Topics Audience_Affinity 27,012 3 ,15,541 8.56% ? 2.47 ? 66,765.34 Apr-18 移动应用程序:mCent Browser - Fast and Safe plus Free Data (Google Play), by mCent https://play.google.com/store/apps/details?id=com.mcent.browser移动应用程序Display- Affinity-Keyword-Topics Display_Keywords 31,898 56,07,897 0.57% ? 1.77 ? 56,368.85 Apr-18 移动应用:Cric Informer(Dream11,Myteam11 Tips & IPL NEWS ) (Google Play), by BRAJ & GEETA INC https://play.google.com/store/apps/details?id=manager.attendance.fantasycrickettips移动应用程序 Display-Affinity-Keyword-Topics Display_Keywords 52,584 61,07,340 0.86% ? 1.76 ? 92,484.03
我已经尝试了所有这些步骤来解决但失败了。请帮助提供解决方案或链接。请转换成 CSV 格式