What to write or search on github to get the code for what is written below:

Cameron Simpson cs at cskk.id.au
Sat Jan 15 16:37:57 EST 2022


On 15Jan2022 02:38, NArshad <narshad.380 at gmail.com> wrote:
>Why does the code written below is not giving any output?
>
>    xls = ExcelFile('ABC.xlsx')
>    df = xls.parse(xls.sheet_names[0], index_col=1)
>    x=df.to_dict()
>    print (x)
>
>Only the contents of the first column and the column number is required 
>in the dictionary

The code above _must_ produce some output, even if it is very short, or 
an error traceback. Is "x" an empty dictionary? Are you getting an 
exception? What is in ABC.xlsx, at least in part? What modules are you 
importing in order to get the name "ExcelFile"? I'm guessing pandas, but 
that is from a web search.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list