Dec-06-2019, 05:38 PM
I tried your code on Linux, but made a few modifications first
modifications:
All worked fine:
modifications:
- imported os and set cwd to the script directory
- placed an xlsx file in the script directory This file just happened to be lying around (Airports.xlsx)
- Opened file directly
All worked fine:
import pandas as pd import os os.chdir(os.path.abspath(os.path.dirname(__file__))) df = pd.read_excel(r'Airports.xlsx')#, sheet_name='blabla') print(df)results when run:
Output: OBJECTID FAA_ID TYPE_ NAME ... OWN_TYPE OWNER MANAGER USE_TYPE
0 1 ILG Airport New Castle Airport ... public New Castle County Delaware River and Bay Authority (DRBA) public
1 2 EVY Airport Summit Aviation ... private Greenwich Aerogroup Greenwich Aerogroup public
2 3 38N Airport Smyrna Airport ... private Barbara Jones Robert Jones public
3 4 33N Airport Delaware Airpark ... public Delaware Department of Transportation (DelDOT) Delaware River and Bay Authority (DRBA) public
4 5 0N4 Airport Chandelle Estates Airport ... private RJR Airdrome Roger Kruser public
5 6 0N5 Heliport DelDOT Helistop ... public Delaware Department of Transportation (DelDOT) DelDOT Office of Aeronautics public
6 7 DOV Air Force Base DAFB & Civil Air Terminal ... military United States Air Force (USAF) United States Air Force (USAF) controlled
7 8 15N Airport Jenkins Airport ... private Joe C. Jenkins Joe C. Jenkins public
8 9 D74 Airport Chorman Airport ... private Allen Chorman Allen Chorman public
9 10 GED Airport Sussex County Airport ... public Sussex County Sussex County public
10 11 N06 Airport Laurel Airport ... private DEST Inc. ACFT Inspection & Maintenance public