I tried "Streamlit" which turns the Python code into a web application as it is

Official site: https://www.streamlit.io/

It's the easiest way for data scientists and machine learning engineers to create beautiful, good-performing apps in hours.

I just tried it because it looks interesting.


Referenced articles

-Official document -I touched Streamlit, which makes it easy to create web applications from Python scripts -Streamlit: Front End for Data Scientists -I made a probability distribution simulation app with Streamlit



What was made

I made a video of the moving part.

https://www.youtube.com/watch?v=WFV-cBQARbQ

Central limit theorem that the graph of the average value when rolling several dice is close to the normal distribution when the number of dice is increased. % BF% 83% E6% A5% B5% E9% 99% 90% E5% AE% 9A% E7% 90% 86) demo app.



For those who want to try this app

The source code is published on Gist, so anyone can run it by installing Streamlit.

Installation method

pip streamlit

Execution method

streamlit run https://gist.githubusercontent.com/kokuyokugetter/1a7ec1243f469be03fa4574c05bf5018/raw/a49ca69a2f33a9945602caddd607898e2bf0b0ac/clt_demo_dice.py

In short, it seems that you should feed the source code after streamlit run. Since gist can call the raw data page of the raised code, it can be executed from the link without downloading the source.


It was also a mistake to erase what I wrote while trying various things, so the part of trial and error and the code of the reference site are listed as they are, but please do not worry about the comment part (especially the first half) of the source code.

I can tell from the source that I stopped doing it first with numpy.histogram and streamlit.barchart because the graph was messed up.

I'm not sure if the integer value and numpy.histogram are incompatible or streamlit.barchart is incompatible.





Impressions

Since you can draw on the graph while changing the variable with the slider, it seems that there will be more effective scenes than changing the value of the variable one by one with jupyter and executing it again.

Recommended Posts

I tried "Streamlit" which turns the Python code into a web application as it is
I tried using "Streamlit" which can do the Web only with Python
I tried Diagram as Code (Diagrams) which can manage the configuration diagram code
I tried benchmarking a web application framework
[Streamlit] I hate JavaScript, so I make a web application only with Python
I tried to explain what a Python generator is for as easily as possible.
[ES Lab] I tried to develop a WEB application with Python and Flask ②
[Python] I tried to get the type name as a string from the type function
Image processing with Python (I tried binarizing it into a mosaic art of 0 and 1)
[Markov chain] I tried to read a quote into Python.
I tried to divide the file into folders with Python
I tried to remodel the code of Python beginner (junior high school student) into object-oriented crunchy
Run the output code on the local web server as "A, pretending to be B" in python
I tried using "Asciichart Py" which can draw a beautiful graph on the console with Python.
Delete a particular character in Python if it is the last
I tried using the COTOHA API (there is code on GitHub)
I tried to make a 2channel post notification application with Python
I tried to make a todo application using bottle with python
I made a scaffolding tool for the Python web framework Bottle
The road to web application development is a long way off
I tried web scraping with python.
I ran GhostScript with python, split the PDF into pages, and converted it to a JPEG image.
How to input a character string in Python and output it as it is or in the opposite direction.
I made a web application that converts photos into Van Gogh's style
When I tried to run Python, it was skipped to the Microsoft Store
I made a web application in Python that converts Markdown to HTML
I tried to get the authentication code of Qiita API with Python.
I tried to discriminate a 6-digit number with a number discrimination application made with python
A python program that resizes a video and turns it into an image
I want to make a web application using React and Python flask
[Python] I made a web scraping code that automatically acquires the news title and URL of Nikkei Inc.
I tried a functional language with Python
[Python] A quick web application with Bottle!
[python] [meta] Is the type of python a type?
[Python] Complete preprocessing Memo as it is
Python: I tried the traveling salesman problem
Wrangle x Python book I tried it [1]
I tried to make a Web API
Run a Python web application with Docker
I tried the Python Tornado Testing Framework
I made a WEB application with Django
I tried to make a simple mail sending application with tkinter of Python
When I tried to create a virtual environment with Python, it didn't work
Since python is read as "Pichon", it can be executed with "Pichon" (it is a story)
I tried to verify the Big Bang theorem [Is it about to come back?]
I searched for the skills needed to become a web engineer in Python
I tried to refactor the code of Python beginner (junior high school student)
[Python] I tried the same calculation as LSTM predict with from scratch [Keras]
I tried to make OneHotEncoder, which is often used for data analysis, so that it can reach the itch.
I tried "smoothing" the image with Python + OpenCV
I tried web scraping to analyze the lyrics.
vprof --I tried using the profiler for Python
I tried web scraping using python and selenium
I made a GUI application with Python + PyQt5
I tried "differentiating" the image with Python + OpenCV
I tried playing a typing game in Python
I tried simulating the "birthday paradox" in Python
I tried the least squares method in Python
I tried Python! ] I graduated today from "What is Python! Python!"!
I tried python programming for the first time.
[Memo] I tried a pivot table in Python