Why do I get Pandas ValueError: invalid literal for int() with base 10: 'undefined' when I try to lo

Best Answer

  • raksina.samasiri
    Answer ✓

    hi @smeetdev.vora

    This error is not related to Eikon Data API, it's related to how Pandas library handle the input Excel file.

    However, I spotted that the error is because the excel file contains the string '--' in column Coupon and when Pandas's read_excel function is executed, it's failed to convert the string into int hence the error is thrown.

    1643019775806.png

    According to this question on Stackoverflow, one of the ways to fix this is to convert the file from xlsx to csv, then use read_csv instead of read_excel to read the data

    1643022633657.pngHope this could help

Answers