Skip to content
Snippets Groups Projects
Commit d3ae3187 authored by amilashanaka's avatar amilashanaka
Browse files

prepare data set change datset apperence

parent cb8a4e41
Branches
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@ from keras.layers import Dense, LSTM, Dropout
import warnings
warnings.filterwarnings("ignore")
from datetime import datetime as dt
data = pd.read_csv("data/product__demnd.csv")
print(data)
......@@ -31,3 +33,26 @@ data.dropna(inplace=True)
print(data.isnull().sum())
data.sort_values('Date', ignore_index=True, inplace=True)
print(data.head())
data['OrderDemand'] = data['OrderDemand'].str.replace('(',"")
data['OrderDemand'] = data['OrderDemand'].str.replace(')',"")
data['OrderDemand'] = data['OrderDemand'].astype('int64')
# convert the 'Date' column to datetime format
data['Date']= pd.to_datetime(data['Date'])
# create Year, Month, Day columns
data['Year'] = data["Date"].dt.year
data['Month'] = data["Date"].dt.month
data['Day'] = data["Date"].dt.day
# i used second way because i think it is more usable for dtypes
# information about data
print(data.info())
print(data["OrderDemand"].describe())
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment