Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
Having problem displaying dataframe with streamlit
data_to_graph = combined_summary_df.unstack(level=1, fill_value=0)

with st.expander("Where to test everything related to graph"):
    st.write(data_to_graph)

"I am new to Streamlit. I would like to impress my superior with it. Any help, Please!!!

The error below has been returned to me everytime I used the chunk of code above to display my dataframe in Streamlit:"

*

SyntaxError: Unexpected token s in JSON at position 6 at JSON.parse () at http://localhost:8501/static/js/main.970d3503.chunk.js:2:17823 at Array.map () at Function.value (http://localhost:8501/static/js/main.970d3503.chunk.js:2:17792) at new e (http://localhost:8501/static/js/main.970d3503.chunk.js:2:10780) at e.get (http://localhost:8501/static/js/main.970d3503.chunk.js:2:428662) at sn (http://localhost:8501/static/js/main.970d3503.chunk.js:2:461308) at ia (http://localhost:8501/static/js/5.26b8f29c.chunk.js:2:3245026) at Gl (http://localhost:8501/static/js/5.26b8f29c.chunk.js:2:3297484) at Pc (http://localhost:8501/static/js/5.26b8f29c.chunk.js:2:3284658)

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Here is a sample multi-indexed frame, streamlit is ok. Can you try that?

Code

import pandas as pd
import numpy as np
import streamlit as st 


index = pd.MultiIndex.from_tuples([('one', 'a'), ('one', 'b'),
                                   ('two', 'a'), ('two', 'b')])

df = pd.DataFrame(np.random.randn(4, 2), index=index)

st.write('##### Multiindex df')
st.table(df)

u1 = df.unstack(level=1)
st.write('##### unstack level=1')
st.table(u1)

Output

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda