dataCSV_test / app.py
yvesJR-237's picture
Create app.py
1d81f85 verified
raw
history blame contribute delete
740 Bytes
import matplotlib.pyplot as plt
import streamlit as st
import seaborn as sns
import pandas as pd
import numpy as np
# Title of the page
st.title("File Uploader")
st.subheader("Input CSV")
# uploading the file
uploaded_file = st.file_uploader('Upload a csv')
# Getting the uploaded file
if uploaded_file is not None:
df = pd.read_csv(uploaded_file)
st.subheader("Dataframe")
# Affichage du csv
st.write(df)
# Graphique
col1, col2 = st.columns(2)
with col1:
figure1 = plt.figure()
sns.scatterplot(x='EstimatedSalary', y='Age', hue='Purchased', data=df)
st.pyplot(figure1)
with col2:
figure2 = plt.figure()
sns.histplot(x='Age', data=df)
st.pyplot(figure2)