Search code examples
pandasdata-analysisdata-sciencepython-extensions

How Can I import a Data set in Jupiter notebook (AD_Data.xlsx) data got xlsx extention


Tried all the possible options like

import pandas as pd

df = pd.read_csv('AD_Data')

data = pd.ExcelFile("AD_Data")
xl_file = pd.ExcelFile(AD_Data)

dfs = {sheet_name: xl_file.parse(AD_Data) for sheet_name in xl_file.AD_Data}
dfs = pd.read_excel(AD_Data, sheetname=None)

None of them are helping

The error I am getting that FileNotFoundError: File b'adData' does not exist

notebook and Data is in the same Folder. I tried keeping different folder too, did not help.

I can use / import any other file like text and convert to DataFrame and work on it in same note book and from same data folder.


Solution

  • pd.read_excel (Python 3.6.4) works fine with xlsx on Windows.

    Add the fileending .xlsx or make sure the file is in the same folder as the script.

    dfs = pd.read_excel(r'C:\users\ilja\Desktop\Mappe1.xlsx', sheet_name=None)
    print(dfs)
    # OrderedDict([('Tabelle1',    1  5
    # 0  2  6
    # 1  3  7)])