Geek7 commited on
Commit
5179666
·
verified ·
1 Parent(s): 6e74a3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -14,7 +14,8 @@ def fetch_stock_data(symbol, start_date, end_date):
14
 
15
  # Function to create features for the model
16
  def create_features(data):
17
- data['Date'] = data.index
 
18
  data['Year'] = data['Date'].dt.year
19
  data['Month'] = data['Date'].dt.month
20
  data['Day'] = data['Date'].dt.day
 
14
 
15
  # Function to create features for the model
16
  def create_features(data):
17
+ data['Date'] = pd.to_datetime(data['Date']) # Convert 'Date' to datetime format
18
+
19
  data['Year'] = data['Date'].dt.year
20
  data['Month'] = data['Date'].dt.month
21
  data['Day'] = data['Date'].dt.day