I’m too familiar with the internals of geopandas, but it looks like your KML file might have a sentinel value for missing in it? So that does not get converted to geom type, and then when you try to use the method it chokes.
Can you try something like df['geometry_str'] = [str(x) for x in df['geometry']? Pretty sure that base Python falls back to calling repr_str or something similar so almost anything works.
Hello @randyzwitch , thank you for your reply. The KML files are not the problem, they are not missing any value. In this case I wanted to use Streamlit to display the results of a project I have done and so far the only problem I have had is with displaying the data from the KML files in a data frame, for the rest of the calculations I have no problem. It is true that the “geometry” column of the KML files is quite special, I think that simply disturbs it because it is something very specific to Geopandas. I tried what you advised me but it didn’t work either, the best result I got was using st.write, but that piece of code comes out as I show in my first post.
I think the solution to this problem is more complex to deal with and is directly related to geopandas, for now I will simply not show a data frame, the rest of the code works fine.