File size: 740 Bytes
1d81f85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)