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
#3
As mention bye @buran the path is wrong.
The file is also not good had to save in Excel(which complain that file is corrupt).
So save it to test.xlsx,now it work in xlrd(as you don't need pandas can read excel).
E.g pandas.read_excel()
>>> import pandas

>>> df = pandas.read_excel('test.xlsx')
>>> df.head()
  Unnamed: 0 Data statistics     Unnamed: 2  Number of   Unnamed: 4  \
0         NaN             NaN            NaN        NaN          NaN   
1         NaN  Records passed            NaN      3.079          NaN   
2         NaN             NaN            NaN        NaN          NaN   
3         NaN             NaN            NaN        NaN          NaN   
4         NaN  JOURNAL_NUMBER  DOCUMENT TYPE        NaN  POSTING KEY   

      Unnamed: 5   Unnamed: 6    Unnamed: 7          Unnamed: 8  \
0             NaN          NaN           NaN                 NaN   
1             NaN          NaN           NaN                 NaN   
2             NaN          NaN           NaN                 NaN   
3             NaN          NaN           NaN                 NaN   
4  GL_ACCT_NUMBER  DESCRIPTION  DEBIT/CREDIT              AMOUNT   

      Unnamed: 9 Unnamed: 10 Unnamed: 11  Unnamed: 12  
0             NaN         NaN         NaN          NaN  
1             NaN         NaN         NaN          NaN  
2             NaN         NaN         NaN          NaN  
3             NaN         NaN         NaN          NaN  
4  EFFECTIVE_DATE  ENTRY_DATE      PERIOD  PREPARER_ID  

>>> df['Data statistics'][:15]
0                NaN
1     Records passed
2                NaN
3                NaN
4     JOURNAL_NUMBER
5                NaN
6         1003001182
7         1003001182
8         1003001183
9         1003001183
10        1003001184
11        1003001184
12        1003001184
13        1003001184
14        1003001185
Name: Data statistics, dtype: object
Reply


Messages In This Thread
RE: Problem of getting XLS file data into python - by snippsat - Jan-19-2017, 07:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add data to CSV file via Python Anaconda23 0 732 Dec-30-2022, 02:31 AM
Last Post: Anaconda23
  how to handling time series data file with Python? aupres 4 3,024 Aug-10-2020, 12:40 PM
Last Post: MattKahn13
  Python numpy fft from data file magnet1 1 2,784 Feb-06-2020, 07:30 AM
Last Post: magnet1
  Colormap data from file - pcolormesh problem alrm31015 0 2,577 May-19-2019, 10:20 PM
Last Post: alrm31015
  Problem with saving data and loading data to mysql kirito85 4 3,932 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,399 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