python - 笔记本中的 Python 错误代码,[Errno 22] 无效参数:'.....\test python.xlsx'
问题描述
我正在尝试使用 Pandas 将 xlsx 文件读入 Python。
如果你看到代码,我发现了一个问题。第一个 pd.read_excel() 可以工作,但第二个不行。两者都是相似的代码行,但第二个 pd.read_excel() 不会读取 xlsx 文件
import pandas as pd
df = pd.read_excel (r"D:\Users\act_gwj\Downloads\test python.xlsx") #- this will work
df = pd.read_excel (r"D:\Users\act_gwj\Downloads\test python.xlsx") # - this doesn't
print (df)
错误:
OSError: [Errno 22] Invalid argument: '\u202aD:\\Users\\act_gwj\\Downloads\\test python.xlsx'
我在 Anaconda Notebook 32 位上使用 Python 3.6.5。熊猫版本 0.25.1
提前致谢
解决方案
推荐阅读
- c# - 有没有办法在 C# Entity Framework 中使用 lambda 表达式优化一对多连接,其中许多是数组其他表记录?
- reactjs - 在 react-image-lightbox 中分离图像
- python - sqlalchemy外表上的聚合函数
- android - 由于从用户输入创建对象时需要很长时间,Kotlin Room 无法将新对象添加到视图模型存储库
- python - Python FTDI LibFT4222.dll 包装器
- command-line - 如何正确地将命令行 VLC 连接到 iTunes 和 Spotify?
- flutter - 颤振计数动画
- python - 如何解决,无法将符号张量 (IteratorGetNext:1) 转换为 numpy 数组
- java - 通过 SSH 隧道连接到 Elasticsearch
- ios - 为 iOS 应用程序条纹 Apple Pay 网络服务?