【发布时间】:2020-10-28 09:04:55
【问题描述】:
我正在尝试使用 Python 3.8.6 运行 python 代码,但出现以下错误:
OSError: [WinError 193] %1 is not a valid Win32 application
我无法解决此错误。
我的代码如下:
import os
print(os.getcwd())
import pandas as pd
import numpy as np
dfTextonly = pd.DataFrame(pd.read_csv('internal_all_txt.csv', low_memory=False, header=1))
dfTextonly = dfTextonly[['Address','Status Code', 'Word Count' ,'Outlinks', 'Unique Outlinks', 'Inlinks', 'Unique Inlinks',"Canonical Link Element 1"]].copy()
dfJS = pd.DataFrame(pd.read_csv('internal_all_js.csv', low_memory=False, header=1))
dfJS = dfJS[['Address','Status Code', 'Word Count', 'Outlinks', 'Unique Outlinks', 'Inlinks', 'Unique Inlinks',"Canonical Link Element 1"]].copy()
df = pd.merge(dfTextonly, dfJS, left_on='Address', right_on='Address', how='outer')
df['Diff Wordcount'] = df['Word Count_y'] - df['Word Count_x']
df['Diff Outlinks'] = df['Outlinks_y'] - df['Outlinks_x']
df['Diff Unique Outlinks'] = df['Unique Outlinks_y'] - df['Unique Outlinks_x']
df['Diff Inlinks'] = df['Unique Inlinks_y'] - df['Unique Inlinks_x']
df["Canonicals are equal"] = np.where((df["Canonical Link Element 1_y"] == df["Canonical Link Element 1_x"]), "yes", "no")
df.to_excel("rendering-test.xlsx")
关于为什么会这样的任何想法?谢谢!
【问题讨论】:
标签: python python-3.8