Simple webpage web app wrapper
![simple webpage web app wrapper simple webpage web app wrapper](https://digilord.nyc3.digitaloceanspaces.com/31.220.61.170/uploads/2019/10/1571340668_639_How-to-Make-a-Website.jpg)
# Create a section for the dataframe statistics st.header('Statistics of Dataframe') st.write(df.describe()) # Create a section for the dataframe header st.header('Header of Dataframe') st.write(df.head()) We wrap these functions inside of the st.write() method and all of the formatting will be sorted automatically. Display Pandas Describe and Data Within StreamlitĪccessing the df.describe() and df.head() methods from pandas is very simple.
#Simple webpage web app wrapper code
This way the subsequent code will not be run unless the file has been uploaded. if upload_file is not None: # Read the file to a dataframe using pandas df = pd.read_csv(upload_file)Īll remaining code can now be placed indented and under this if statement. If it has, then read the uploaded csv file. Once we have the file uploader setup, we now need to add some basic logic to detect when a file has been uploaded. The file uploader dialogue using st.file_uploader(). Once your web browser opens, you will notice two things, a hamburger menu in the top right and the text Made with Streamlit in the bottom left. You will also be presented with the web address in the terminal should you wish to open up the app in another browser. Your browser window should open and you will be presented with a blank streamlit window like the one below. To confirm streamlit has been installed and imported correctly and that it can be run, go to the terminal and navigate to where your app.py file is located and run the following command: streamlit run app.py
![simple webpage web app wrapper simple webpage web app wrapper](https://i.ytimg.com/vi/Ouo7F7tc6YE/maxresdefault.jpg)
#Import the required Libraries import streamlit as st import pandas as pd import matplotlib.pyplot as plt Running The Streamlit App For this simple app we will be importing streamlit, pandas and matplotlib. The first coding step in the process is to import the required libraries. In your chosen Python IDE, create a new file called app.py.
#Simple webpage web app wrapper install
pip install streamlit Building A Streamlit App Create an app.py file This can simply be done using the following command if you are using PIP. Before we can run Streamlit apps, we first need to install the library.