# Streamlit doesn't display pandas data frame

**URL:** <https://discuss.streamlit.io/t/streamlit-doesnt-display-pandas-data-frame/29214>\
**Category:** Using Streamlit\
**Created:** [August 15, 2022, 11:23am UTC](https://discuss.streamlit.io/t/streamlit-doesnt-display-pandas-data-frame/29214 "2022-08-15T11:23:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![groot](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@groot](https://discuss.streamlit.io/u/groot)\
**Post date:** [August 15, 2022, 11:23am UTC](https://discuss.streamlit.io/t/streamlit-doesnt-display-pandas-data-frame/29214/1 "2022-08-15T11:23:01Z")

</div>

Hello, I am transposing a pandas df, and trying to print out using st.table().  
The code:

```auto
from astroquery.ipac.ned import Ned

objectInput = 'ABELL 2218'
result_tableNED = Ned.query_object(objectInput)
dataFrameObjectNED = result_tableNED.to_pandas()
st.table(dataFrameObjectNED.T)

```

Error:

```auto
StreamlitAPIException: ("Could not convert 'ABELL 2218' with type str: tried to convert to int64", 'Conversion failed for column 0 with type object')

```

Same code in jupyter works fine but without using streamlit.  
Thank you

---

<div class="post-metadata">

**Author:** ![blackary](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/blackary/32/47725_2.png) [@blackary](https://discuss.streamlit.io/u/blackary)\
**Post date:** [August 15, 2022, 2:21pm UTC](https://discuss.streamlit.io/t/streamlit-doesnt-display-pandas-data-frame/29214/2 "2022-08-15T14:21:13Z")

</div>

It’s a bit of a hack, but if you’re just trying to display the data, you can convert it all to strings, then either display it with st.table or st.dataframe

```python
import streamlit as st
from astroquery.ipac.ned import Ned

objectInput = "ABELL 2218"
result_tableNED = Ned.query_object(objectInput)
dataFrameObjectNED = result_tableNED.to_pandas()

dataFrameObjectNED = dataFrameObjectNED.astype(str)

st.table(dataFrameObjectNED.T)
st.dataframe(dataFrameObjectNED.T)

```

---

<div class="post-metadata">

**Author:** ![groot](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@groot](https://discuss.streamlit.io/u/groot)\
**Post date:** [August 15, 2022, 2:46pm UTC](https://discuss.streamlit.io/t/streamlit-doesnt-display-pandas-data-frame/29214/3 "2022-08-15T14:46:27Z")

</div>

Thank you, will try it!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [August 15, 2023, 2:46pm UTC](https://discuss.streamlit.io/t/streamlit-doesnt-display-pandas-data-frame/29214/4 "2023-08-15T14:46:35Z")

</div>

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
