-
Notifications
You must be signed in to change notification settings - Fork 0
/
2nd_prac.py
53 lines (36 loc) · 1.39 KB
/
2nd_prac.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# importing libraries
import pandas as pd
import numpy as np
import streamlit as st
import plotly.express as px
import seaborn as sns
# importing datasets
st.title("plotly ky graph streamlit mein display krwany")
df = px.data.wind()
st.write(df.sample(10))
st.write(df.columns)
# summry stat
st.write(df.describe())
st.write(df.shape)
st.write(df['strength'].max())
st.write(df['frequency'].max())
st.write(df['frequency'].min())
# data management
dist = df["direction"].unique().tolist()
district = st.selectbox("jaldi naa direction winner chose kr", dist)
# df = df[df["direction"]==dist]
# # plotting
graph_op = px.scatter(df, x= "frequency", y= "strength", color="direction",
range_y=[0,7], range_x=[0.05, 2.6],
animation_frame="strength", animation_group="strength")
st.write(graph_op)
# graph-2
graph_op2 = px.scatter(df, x= "frequency", y= "strength", color="direction",
range_y=[0,4], range_x=[0.05, 2.6],
animation_frame="frequency", animation_group="strength")
st.write(graph_op2)
# with no animation
graph_op3 = px.scatter(df, x= "frequency", y= "strength", color="direction",
range_y=[0,4], range_x=[0.05, 2.6],)
# animation_frame="frequency", animation_group="strength")
st.write(graph_op3)