Shrikrishna commited on
Commit
3aad77e
1 Parent(s): e7ce3ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -2,8 +2,6 @@ import streamlit as st
2
  import numpy as np
3
  import pandas as pd
4
  import matplotlib.pyplot as plt
5
-
6
- #!pip install yfinance
7
  import yfinance as yf
8
  yf.pdr_override()
9
  from pandas_datareader import data as pdr
@@ -22,4 +20,19 @@ st.write(df.describe())
22
  st.subheader("Closing Price VS Time Chart:")
23
  fig = plt.figure(figsize=(12,6))
24
  plt.plot(df.Close)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  st.pyplot(fig)
 
2
  import numpy as np
3
  import pandas as pd
4
  import matplotlib.pyplot as plt
 
 
5
  import yfinance as yf
6
  yf.pdr_override()
7
  from pandas_datareader import data as pdr
 
20
  st.subheader("Closing Price VS Time Chart:")
21
  fig = plt.figure(figsize=(12,6))
22
  plt.plot(df.Close)
23
+ st.pyplot(fig)
24
+
25
+ moving_avg_100 = df.Close.rolling(100).mean()
26
+ st.subheader("Closing Price VS Time Chart With 100Moving Average:")
27
+ fig = plt.figure(figsize=(12,6))
28
+ plt.plot(df.Close)
29
+ plt.plot(moving_avg_100,'red')
30
+ st.pyplot(fig)
31
+
32
+ moving_avg_200 = df.Close.rolling(200).mean()
33
+ st.subheader("Closing Price VS Time Chart With 100Moving Average and 200Moving Average:")
34
+ fig = plt.figure(figsize=(12,6))
35
+ plt.plot(df.Close)
36
+ plt.plot(moving_avg_100,'red')
37
+ plt.plot(moving_avg_200,'green')
38
  st.pyplot(fig)