https://www.dropbox.com/s/fipykgf6bugtuxc/amwtmu_demo.gif?dl=0
Download the gif and play it.
import streamlit as st | |
import traceback | |
# https://gist.github.com/tvst/6e62360a712ed0595e7a0749127fba58 | |
class opt_echo: | |
"""Replacement for st.echo that includes a checkbox saying "show code". | |
Usage | |
----- | |
>>> with opt_echo(): | |
... a = 1337 |
import streamlit as st | |
import pandas as pd | |
import pydeck as pdk | |
view_state = pdk.ViewState(latitude=32, | |
longitude=35, | |
zoom=7, | |
pitch=0) | |
d1 = {'lon': [35, 35.1], 'lat': [32.5, 32.6], 'name':['meA', 'meB'], 'prec':[100,300], 'temp':[10,30], 'elevationValue':[100,300]} |
''' | |
Run Streamlit apps inside other apps. See: https://discuss.streamlit.io/t/multiple-apps-from-a-folder-file-list/181 | |
''' | |
import streamlit as st | |
import os | |
import sys | |
import importlib.util | |
# https://gist.github.com/tvst/f13b24198e256c1c4d9b5ccbc6991cc2 |
import asyncio | |
import streamlit as st | |
from datetime import datetime | |
st.set_page_config(layout="wide") | |
st.markdown( | |
""" | |
<style> | |
.time { |
"""From https://matplotlib.org/3.1.0/gallery/mplot3d/voxels.html in Streamlit""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import streamlit as st | |
# This import registers the 3D projection, but is otherwise unused. | |
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import | |
@st.cache |
import streamlit as st | |
def main(): | |
pages = { | |
"Home": page_home, | |
"Settings": page_settings, | |
} | |
if "page" not in st.session_state: |
import streamlit as st | |
st.header('Experiments with forms') | |
st.markdown('There is no connection between the forms here. The purpose is to demonstrate 3 different ways to run operations with form values.') | |
state = st.session_state | |
if 'word_choices' not in state: | |
state.word_choices = [] |
https://www.dropbox.com/s/fipykgf6bugtuxc/amwtmu_demo.gif?dl=0
Download the gif and play it.
# My solution to this: https://discuss.streamlit.io/t/the-if-else-appear-anyway/24713/7 | |
import streamlit as st | |
import spacy | |
from spacy import displacy | |
from spacy.matcher import PhraseMatcher | |
nlp = spacy.load('en_core_web_sm') #some alternatives en_core_web_md, en_core_web_lg | |
nlp.disable_pipes('ner') |
# Generic answer to this question: https://discuss.streamlit.io/t/how-to-work-date-input-with-shortcuts/25377 | |
import streamlit as st | |
state = st.session_state | |
def _set_start_cb(): | |
if state.start > state.end: | |
state.start = state.end | |
def _set_end_cb(): | |
if state.end < state.start: |