TypeError: object cannot be converted to an IntegerDtype

From what I understand is that the default dataframe int datatype does not allow for NA, so it’ll convert these columns to float. The standard way to handle this is to use the fillna() method, but you must put in a value which people typically use 0. 0 is not NA, it’s a value, so I don’t want this.

So I found this StackOverflow post:

which indicated that if I convert to Int64 instead of int64 I can use a pandas datatype that accepts NA

for col_name, item in df.iteritems():
    df[col_name] = df[col_name].astype('Int64')

Running this gives me an error.

I’m running this locally to get this error, I haven’t yet pushed this to the GitHub, but I can if the community wants to recreate the error with my app.

https://share.streamlit.io/peej1226/sbcc_kattis_app/sbcc_app/src/streamlit_kt2.py

Here is my app, I pushed the changes, to cause the change, you’d pick the Rank with errors option.