擅长:python、mysql、java
<p>我在jupyter环境中运行了你的代码,它成功了。没有提示错误,但数据帧只有NaN值。我检查了你试图读取的xls文件,它似乎不包含任何数据。。。你知道吗</p>
<p>还有其他方法可以检索xls数据,例如:<a href="https://stackoverflow.com/questions/25415405/downloading-an-excel-file-from-the-web-in-python">downloading an excel file from the web in python</a></p>
<pre><code>import requests
url = 'https://www.dax-indices.com/documents/dax-indices/Documents/Resources/WeightingFiles/Ranking/2019/March/MDAX_RKC.20190329.xls'
resp = requests.get(url)
output = open('my-sheet.xls', 'wb')
output.write(resp.content)
output.close()
df=pd.read_excel('my-sheet.xls')
print(df.head())
</code></pre>