Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- def predict(df):
- last = df.columns[-1]
- mp = df[last].mean()
- return round(mp, 4)
- def main():
- df = pd.read_csv("Equity.csv")
- df['Date'] = pd.to_datetime(df['Date'])
- df = df.sort_values('Date')
- prediction = predict(df)
- print(f'Predicted "Adj Close" price = {prediction}')
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement