Sep-30-2019, 09:54 PM
HI-
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
pTabNames='abc','cbd','efg'
pColumnName='col1,col2'
Code:
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:Error:
raise XLRDError('No sheet named <%r>' % sheet_name)
xlrd.biffh.XLRDError: No sheet named <"''abc','cbd','efg'">
Params Read from another filepTabNames='abc','cbd','efg'
pColumnName='col1,col2'
Code:
import sys import json import glob import pandas as pd import xlrd pExcelName=lst['pExcelName'] pColumnName=lst['pColumnName'] pTabNames=lst['pTabNames'] pSkipRows=lst['pSkipRows'] tabs=[ pTabNames] for i in tabs: df = pd.read_excel( pExcelName , sheet_name= i , skiprows= pSkipRows , usecols= pColumnName )kindly assit