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
# One day returns calculation through differencing by 1 | |
differencing_factor = 1 | |
df_daily_returns = (df_raw - df_raw.shift(differencing_factor)) / df_raw.shift(differencing_factor) * 100 | |
df_daily_returns.plot(figsize=figsize) | |
plt.title(f'{asset_name} Daily Returns via Differencing 1 Day'); |
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
# Critical imports for GPU cuDF | |
import nvstrings, nvcategory, cudf | |
# Other imports | |
import numpy as np | |
import pandas as pd | |
import time | |
import pandas_datareader.data as web | |
from datetime import datetime | |
from matplotlib import pyplot as plt |
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
int raiseToPower(int base, int exponent) { | |
int result = 1; | |
for (int i = 0; i < exponent; i = i + 1) { | |
result = result * base; | |
} | |
return result; | |
} |
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
#include <iostream> | |
using namespace std; | |
int main() { | |
int x = 0; | |
for (; x <= 10;) { | |
x = x + 1; | |
cout << "x is " << x << "\n"; | |
} | |
return 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
#include <iostream> | |
using namespace std; | |
int main() { | |
int x = 0; | |
int y = 2; | |
while (x < 10) { | |
x = x + 1; | |
cout << "x is " << x << "\n"; | |
} |
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
#include <iostream> | |
using namespace std; | |
int main() { | |
int x = 6; | |
int y = 2; | |
if(x > y) | |
cout << "x is greater than y\n"; | |
else if(y > x) | |
cout << "y is greater than x\n"; |
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
#include <iostream> | |
using namespace std; | |
int main() { | |
int x; | |
cin >> x; | |
cout << x / 3 << ' ' << x * 2; | |
return 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
// Just a simple program | |
#include <iostream> | |
int main() { | |
std::cout << "Hello, world!\n"; | |
return 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
// Tell the preprocessor to dump the contents into iostream that defines our io | |
#include <iostream> | |
// This tells the compiler that it should look in the std namespace for any identifiers we haven't defined | |
using namespace std; | |
// Initiate | |
int main() { | |
// We declare the variable with int x then initialize x by specifying a value | |
int x = 4 + 2; |
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 tensorflow as tf | |
from keras import backend as K | |
from keras.layers import Dense | |
from keras.objectives import categorical_crossentropy | |
from keras.metrics import categorical_accuracy as accuracy | |
from keras.datasets import cifar10 | |
from keras.utils import np_utils | |
from keras.layers import Dense, Activation, Flatten, Lambda, Convolution2D, Convolution1D, AveragePooling2D, BatchNormalization, Dropout, Reshape | |
from keras.engine import merge, Input, Model | |
from keras.engine.training import collect_trainable_weights |
NewerOlder