我是Python的新手,我试图在python中读取一个大的excel文件。我将我的xlsx文件转换为csv以使用pandas。我写了下面的代码:
class VehicleThatCouldBeParked {}
class Car extends VehicleThatCouldBeParked {}
class Van extends VehicleThatCouldBeParked {}
...
VehicleThatCouldBeParked []parking = ne VehicleThatCouldBeParked[100]; // build a parking with hundred locations
...
Car myCar = new Car(); // some car
...
Van myVan = new Van(); // some van
...
parking[76] = myCar; // my car is parked in slot 77
parking[34] = myVan; // my van is parked in slot 35
...
但它给出了这个错误:
import pandas as pd
pd.read_csv('filepath.csv')
df = csv.parse("Sheet")
df.head()
你能告诉我为什么会出现这个错误吗?或者您有什么建议来阅读大型Excel文件?我也尝试使用UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 28: character maps to <undefined>
模块,但由于我的Python版本,我无法使用openpyxl
。(我使用的是Python 2.7.8)