fschwartzer commited on
Commit
6ce9926
1 Parent(s): b115468

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +122 -1
app.py CHANGED
@@ -292,7 +292,128 @@ with tab3:
292
  else:
293
  st.warning(f"**Dados insuficientes para inferência do valor. Mínimo necessário:** {k_threshold}")
294
 
 
 
 
295
  with st.spinner('Carregando análise...'):
296
  profile = ProfileReport(filtered_data, title="Análise Exploratória dos Dados", explorative=True)
297
  profile_html = profile.to_html()
298
- components.html(profile_html, height=600, scrolling=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  else:
293
  st.warning(f"**Dados insuficientes para inferência do valor. Mínimo necessário:** {k_threshold}")
294
 
295
+ import streamlit as st
296
+
297
+ # Generate the profile report
298
  with st.spinner('Carregando análise...'):
299
  profile = ProfileReport(filtered_data, title="Análise Exploratória dos Dados", explorative=True)
300
  profile_html = profile.to_html()
301
+
302
+ # Replace English text with Portuguese
303
+ profile_html = profile_html.replace("Overview", "Visão geral")
304
+ profile_html = profile_html.replace("Alerts", "Alertas")
305
+ profile_html = profile_html.replace("Reproduction", "Reprodução")
306
+ profile_html = profile_html.replace("Dataset statistics", "Estatísticas do conjunto de dados")
307
+ profile_html = profile_html.replace("Variable types", "Tipos de variáveis")
308
+ profile_html = profile_html.replace("Variables", "Variáveis")
309
+ profile_html = profile_html.replace("Interactions", "Interações")
310
+ profile_html = profile_html.replace("Correlations", "Correlações")
311
+ profile_html = profile_html.replace("Missing values", "Valores faltantes")
312
+ profile_html = profile_html.replace("Sample", "Amostra")
313
+ profile_html = profile_html.replace("Number of variables", "Número de variáveis")
314
+ profile_html = profile_html.replace("Number of observations", "Número de observações")
315
+ profile_html = profile_html.replace("Missing cells", "Células faltantes")
316
+ profile_html = profile_html.replace("Missing cells (%)", "Células faltantes (%)")
317
+ profile_html = profile_html.replace("Duplicate rows", "Linhas duplicadas")
318
+ profile_html = profile_html.replace("Duplicate rows (%)", "Linhas duplicadas (%)")
319
+ profile_html = profile_html.replace("Total size in memory", "Tamanho total na memória")
320
+ profile_html = profile_html.replace("Average record size in memory", "Tamanho médio do registro na memória")
321
+ profile_html = profile_html.replace("Text", "Texto")
322
+ profile_html = profile_html.replace("Numeric", "Numérico")
323
+ profile_html = profile_html.replace("Categorical", "Categórico")
324
+ profile_html = profile_html.replace("Distinct", "Distinto")
325
+ profile_html = profile_html.replace("Distinct (%)", "Distinto (%)")
326
+ profile_html = profile_html.replace("Missing", "Faltando")
327
+ profile_html = profile_html.replace("Missing (%)", "Faltando (%)")
328
+ profile_html = profile_html.replace("Memory size", "Tamanho da memória")
329
+ profile_html = profile_html.replace("Real number", "Número real")
330
+ profile_html = profile_html.replace("Infinite", "Infinito")
331
+ profile_html = profile_html.replace("Infinite (%)", "Infinito (%)")
332
+ profile_html = profile_html.replace("Mean", "Média")
333
+ profile_html = profile_html.replace("Minimum", "Mínimo")
334
+ profile_html = profile_html.replace("Maximum", "Máximo")
335
+ profile_html = profile_html.replace("Zeros", "Zeros")
336
+ profile_html = profile_html.replace("Zeros (%)", "Zeros (%)")
337
+ profile_html = profile_html.replace("Negative", "Negativo")
338
+ profile_html = profile_html.replace("Negative (%)", "Negativo (%)")
339
+ profile_html = profile_html.replace("Other values (2)", "Outros valores (2)")
340
+ profile_html = profile_html.replace("Link", "Link")
341
+ profile_html = profile_html.replace("UNIQUE", "ÚNICO")
342
+ profile_html = profile_html.replace("CONSTANT", "CONSTANTE")
343
+ profile_html = profile_html.replace("Average", "Média")
344
+ profile_html = profile_html.replace("Number of rows", "Número de linhas")
345
+ profile_html = profile_html.replace("Distinct values", "Valores distintos")
346
+ profile_html = profile_html.replace("Histogram", "Histograma")
347
+ profile_html = profile_html.replace("Top", "Top")
348
+ profile_html = profile_html.replace("Bottom", "Inferior")
349
+ profile_html = profile_html.replace("Frequency", "Frequência")
350
+ profile_html = profile_html.replace("has constant value", "tem valores constantes")
351
+ profile_html = profile_html.replace("has unique value", "tem valores únicos")
352
+ profile_html = profile_html.replace("Analysis started", "Início da análise")
353
+ profile_html = profile_html.replace("Analysis finished", "Término da análise")
354
+ profile_html = profile_html.replace("Duration", "Duração")
355
+ profile_html = profile_html.replace("Software version", "Versão do software")
356
+ profile_html = profile_html.replace("Download configuration", "Configuração para download")
357
+ profile_html = profile_html.replace("Select Columns", "Selecione coluna")
358
+ profile_html = profile_html.replace("Length", "Comprimento")
359
+ profile_html = profile_html.replace("Max length", "Comprimento máximo")
360
+ profile_html = profile_html.replace("Median length", "Comprimento mediano")
361
+ profile_html = profile_html.replace("Mean length", "Comprimento médio")
362
+ profile_html = profile_html.replace("Min length", "Comprimento mínimo")
363
+ profile_html = profile_html.replace("Characters and Unicode", "Caracteres e Unicode")
364
+ profile_html = profile_html.replace("Total characters", "Total de caracteres")
365
+ profile_html = profile_html.replace("Distinct characters", "Caracteres distintos")
366
+ profile_html = profile_html.replace("Distinct categories", "Categorias distintas")
367
+ profile_html = profile_html.replace("Distinct scripts", "Scripts distintos")
368
+ profile_html = profile_html.replace("Distinct blocks", "Blocos distintos")
369
+ profile_html = profile_html.replace("The Unicode Standard assigns character properties to each code point, which can be used to analyse textual variables.", "O Padrão Unicode atribui propriedades de caracteres a cada ponto de código, que podem ser usados para analisar variáveis textuais.")
370
+ profile_html = profile_html.replace("Unique", "Único")
371
+ profile_html = profile_html.replace("Unique (%)", "Único (%)")
372
+ profile_html = profile_html.replace("Words", "Palavras")
373
+ profile_html = profile_html.replace("Characters", "Caracteres")
374
+ profile_html = profile_html.replace("Most occurring characters", "Caracteres mais frequentes")
375
+ profile_html = profile_html.replace("Categories", "Categorias")
376
+ profile_html = profile_html.replace("Most occurring categories", "Categorias mais frequentes")
377
+ profile_html = profile_html.replace("(unknown)", "(desconhecido)")
378
+ profile_html = profile_html.replace("Most frequent character per category", "Caractere mais frequente por categoria")
379
+ profile_html = profile_html.replace("Scripts", "Scripts")
380
+ profile_html = profile_html.replace("Most occurring scripts", "Scripts mais frequentes")
381
+ profile_html = profile_html.replace("Most frequent character per script", "Caractere mais frequente por script")
382
+ profile_html = profile_html.replace("Blocks", "Blocos")
383
+ profile_html = profile_html.replace("Most occurring blocks", "Blocos mais frequentes")
384
+ profile_html = profile_html.replace("Frequency (%)", "Frequência (%)")
385
+ profile_html = profile_html.replace("Most frequent character per block", "Caractere mais frequente por bloco")
386
+ profile_html = profile_html.replace("Matrix", "Matriz")
387
+ profile_html = profile_html.replace("First rows", "Primeiras linhas")
388
+ profile_html = profile_html.replace("Last rows", "Últimas linhas")
389
+ profile_html = profile_html.replace("More details", "Maior detalhamento")
390
+ profile_html = profile_html.replace("Statistics", "Estatísticas")
391
+ profile_html = profile_html.replace("Quantile statistics", "Estatísticas de quantis")
392
+ profile_html = profile_html.replace("Common values", "Valores comuns")
393
+ profile_html = profile_html.replace("Extreme values", "Valores extremos")
394
+ profile_html = profile_html.replace("5-th percentile", "5º percentil")
395
+ profile_html = profile_html.replace("median", "mediana")
396
+ profile_html = profile_html.replace("95-th percentile", "95º percentil")
397
+ profile_html = profile_html.replace("Range", "Intervalo")
398
+ profile_html = profile_html.replace("Interquartile range (IQR)", "Intervalo Interquartil")
399
+ profile_html = profile_html.replace("Descriptive statistics", "Estatísticas descritivas")
400
+ profile_html = profile_html.replace("Standard deviation", "Desvio padrão")
401
+ profile_html = profile_html.replace("Coefficient of variation (CV)", "Coeficiente de variação (CV)")
402
+ profile_html = profile_html.replace("Kurtosis", "Curtose")
403
+ profile_html = profile_html.replace("Median Absolute Deviation (MAD)", "Desvio Absoluto Mediano (MAD)")
404
+ profile_html = profile_html.replace("Skewness", "Assimetria")
405
+ profile_html = profile_html.replace("Sum", "Soma")
406
+ profile_html = profile_html.replace("Variance", "Variância")
407
+ profile_html = profile_html.replace("Monotonicity", "Monotonicidade")
408
+ profile_html = profile_html.replace("Not monotonic", "Não monotônica")
409
+ profile_html = profile_html.replace("Histogram with fixed size bins (bins=16)", "Histograma com intervalos de tamanho fixo (intervalos=16)")
410
+ profile_html = profile_html.replace("Minimum 10 values", "Mínimo 10 valores")
411
+ profile_html = profile_html.replace("Maximum 10 values", "Máximo 10 valores")
412
+ profile_html = profile_html.replace("1st row", "1ª linha")
413
+ profile_html = profile_html.replace("2nd row", "2ª linha")
414
+ profile_html = profile_html.replace("3rd row", "3ª linha")
415
+ profile_html = profile_html.replace("4th row", "4ª linha")
416
+ profile_html = profile_html.replace("5th row", "5ª linha")
417
+
418
+ # Display the modified HTML in Streamlit
419
+ components.html(profile_html, height=600, scrolling=True)