Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Reading Multiple Sheets using Pandas

I am trying to read multiple sheets using Pandas, by parameterizing those Sheet names and column names
While reading the parameter, it is considering entire Param as one string

Error: raise XLRDError('No sheet named <%r>' % sheet_name) xlrd.biffh.XLRDError: No sheet named <"''abc','cbd','efg'">
Params Read from another file


import sys
import json
import glob
import pandas as pd
import xlrd


tabs=[ pTabNames]

for i in tabs:
     df = pd.read_excel(  pExcelName  , sheet_name= i , skiprows= pSkipRows  , usecols= pColumnName )
kindly assit
scidam wrote Sep-30-2019, 11:19 PM:
Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.
I've tried to read excel files using pandas (I prefer to work with a bit simpler format -- csv).
It seems that your tabs variable is a list of len 1, e.g. something like this [('abc','cbd','efg')] (the list includes a tuple). Try it without square brackets: tabs = pTabNames.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  pandas head() not reading all rows naab 0 149 Apr-07-2020, 01:06 PM
Last Post: naab
  XLSX file with multiple sheets to josn file ovidius 2 178 Apr-05-2020, 09:22 AM
Last Post: ovidius
  pandas str.extract multiple regex groups with OR pythonidae 2 1,062 Dec-19-2019, 05:43 PM
Last Post: pythonidae
  Handling multiple errors when using datafiles in Pandas alphanov 1 339 Jul-16-2019, 03:17 AM
Last Post: scidam
  Pandas/Excel, reading from one column writing back to another... williamlombard 1 880 Mar-01-2018, 06:02 AM
Last Post: williamlombard
  Reading json file as pandas data frame? Alberto 1 5,874 Feb-05-2018, 12:43 AM
Last Post: snippsat
  Panda Data Frame to Existing Multiple Sheets naveedraza 1 3,640 Jul-11-2017, 12:21 PM
Last Post: naveedraza
  Write data into existing Excel (xlsx) file with multiple sheets BNB 1 11,530 Jun-01-2017, 04:22 PM
Last Post: Larz60+
  Pythonic way to standardize dates across two excel sheets? maco144 1 1,323 Feb-04-2017, 09:29 PM
Last Post: Larz60+

Forum Jump:

Users browsing this thread: 1 Guest(s)