This file contains 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 | |
import numpy as np | |
def get_train_data(): | |
df = pd.read_csv('datasets/all_stocks_5yr.csv') | |
data_aal = df[df['Name'] == 'AAL'] | |
X_train = data_aal[data_aal.columns[1:5]].values[:-1] | |
Y_train = np.expand_dims(data_aal['open'].values[1:], 1) | |
return X_train, Y_train |
This file contains 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
li = [] | |
for i in range(10): | |
n = int(input('Enter a no: ')) | |
li.append(n) | |
max_val = li[0] | |
for ele in li: | |
if ele > max_val: | |
max_val = ele |
This file contains 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
def get_grade(marks): | |
if marks >= 80: | |
return 'A' | |
elif marks >= 65: | |
return 'B' | |
elif marks >= 50: | |
return 'C' | |
elif marks >= 35: | |
return 'D' | |
return 'E' |
This file contains 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
name = input('Enter Student Name: ') | |
roll_no = int(input('Enter Roll No: ')) | |
subjects_list = ['Maths', | |
'Physics', | |
'Chemistry', | |
'English', | |
'Python'] | |
print('\n' + '-' * 10 + 'GRADING CRITERIA' + '-' * 10) |
This file contains 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
no = int(input('Enter a positive number: ')) | |
if no % 2 == 0: | |
print(no, 'is even.') | |
else: | |
print(no, 'is odd') |
This file contains 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
a = 10 | |
b = 5 | |
print(a + b) | |
print(a - b) | |
print(a * b) | |
print(a / b) | |
print(a // b) | |
print(a % b) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 tensorflow as tf | |
from pprint import pprint | |
def get_weights(shape, name): | |
return tf.get_variable(name, shape=shape) | |
def get_bias(shape, name): | |
return tf.zeros(shape=shape, name=name) |
This file contains 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 tensorflow as tf | |
import pprint | |
def vgg16(is_input_trainable=False, fine_tune_last=False, | |
n_classes=1000, input_shape=[None, 224, 224, 3]): | |
""" | |
@params: | |
is_input_trainable: True in case of Neural Style Transfer to generate images | |
fine_tune_last: Make True if you want to fine tune the model for transfer learning |
NewerOlder