Python Forum
Problem of getting XLS file data into python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem of getting XLS file data into python
#1

.xls   May.XLS (Size: 50.75 KB / Downloads: 206)
.xls   Apr.XLS (Size: 54.54 KB / Downloads: 199)
I'm trying to get the data from 2 XLS files into python. These XLS files were exported files from SAP system.

However i can't get the data into python.

https://drive.google.com/open?id=0B6D2lP...UlYdHFMdHM

https://drive.google.com/open?id=0B6D2lP...0VoR054a1k

Method 1

import glob
import pandas as pd

path = "C:/Users/Desktop/MJ"
file_identifier = "*.XLS"

all_data = pd.DataFrame()
for f in glob.glob(path + "/*" + file_identifier):
    df = pd.read_excel(f)
    all_data = all_data.append(df,ignore_index=True)
No data comes to python variable all_data

Method 2
Also i tried through xlrd

import xlrd

workbook = xlrd.open_workbook('C:/Users/Desktop/MJ/Apr.xls')
Error:
Traceback (most recent call last):   File "<ipython-input-14-9f59ece120e8>", line 2, in <module>     workbook = xlrd.open_workbook('C:/Users/Gishan/Desktop/MJ/Apr.xls')   File "C:\Program Files\Anaconda3\lib\site-packages\xlrd\__init__.py", line 395, in open_workbook     with open(filename, "rb") as f: FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Gishan/Desktop/MJ/Apr.xls'
Can someone help me to solve this.
Reply


Messages In This Thread
Problem of getting XLS file data into python - by klllmmm - Jan-19-2017, 01:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add data to CSV file via Python Anaconda23 0 728 Dec-30-2022, 02:31 AM
Last Post: Anaconda23
  how to handling time series data file with Python? aupres 4 3,010 Aug-10-2020, 12:40 PM
Last Post: MattKahn13
  Python numpy fft from data file magnet1 1 2,771 Feb-06-2020, 07:30 AM
Last Post: magnet1
  Colormap data from file - pcolormesh problem alrm31015 0 2,570 May-19-2019, 10:20 PM
Last Post: alrm31015
  Problem with saving data and loading data to mysql kirito85 4 3,926 Feb-08-2019, 10:53 AM
Last Post: kirito85
  Extract data between two dates from a .csv file using Python 2.7 sujai_banerji 1 10,384 Nov-15-2017, 09:48 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020