This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.preprocessing import StandardScaler | |
| scaler = StandardScaler() | |
| X_train = scaler.fit_transform(X_train) | |
| X_test = scaler.transform(X_test) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.model_selection import train_test_split | |
| X = df.iloc[:, 1:10] | |
| Y = df.iloc[:, 10] | |
| X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.2, random_state = 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df[10] = df[10].replace(2,0).replace(4,1) | |
| print(df) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from google.colab import files | |
| file = files.upload() | |
| data = pd.read_csv("breastCancer.csv", header = None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df = pd.DataFrame(data) | |
| df[6] = df[6].replace('?',0) | |
| df[6] = df[6].astype(int) | |
| print(df.dtypes) | |
| mean = int(df[6].mean()) | |
| df[6] = df[6].replace(0,mean) | |
| print(df) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import libraries | |
| from pandas_datareader import data | |
| import datetime | |
| from bokeh.plotting import figure, show, output_file | |
| #Define time-frame | |
| start_time = datetime.datetime(2018,10,1) | |
| end_time = datetime.datetime(2018,10,9) | |
| #Fetch the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import libraries | |
| from pandas_datareader import data | |
| import datetime | |
| from bokeh.plotting import figure, show, output_file | |
| #Define time-frame | |
| start_time = datetime.datetime(2018,10,1) | |
| end_time = datetime.datetime(2018,10,9) | |
| #Fetch the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import libraries | |
| from pandas_datareader import data | |
| import datetime | |
| from bokeh.plotting import figure, show, output_file | |
| #Define time-frame | |
| start_time = datetime.datetime(2018,10,1) | |
| end_time = datetime.datetime(2018,10,9) | |
| #Fetch the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import libraries | |
| from pandas_datareader import data | |
| import datetime | |
| from bokeh.plotting import figure, show, output_file | |
| #Define time-frame | |
| start_time = datetime.datetime(2018,10,1) | |
| end_time = datetime.datetime(2018,10,9) | |
| #Fetch the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import libraries | |
| from pandas_datareader import data | |
| import datetime | |
| #Define time-frame | |
| start_time = datetime.datetime(2018,10,1) | |
| end_time = datetime.datetime(2018,10,9) | |
| #Fetch the data | |
| df = data.DataReader(name="TSLA",data_source="yahoo", start = start_time, end = end_time) |