Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 2 2

Why do I get Pandas ValueError: invalid literal for int() with base 10: 'undefined' when I try to load a downloaded excel file from GOVSRCH into Python via read_excel?

Pandas Version: 1.1.5

eikon-data-apipythonpandas
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
14.5k 30 5 10

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


1643019775806.png (110.2 KiB)
1643022633657.png (187.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
17.9k 82 39 63

Hi @smeetdev.vora

An alternative way to pull down the contracts is to utilize the Search APIs directly as opposed to manually creating and exporting a spreadsheet and importing it into your application.

If this is of interest, you can review the source code for this debt structure analysis article and also look at a series of examples of how to use search.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.