Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 scapy.all import * | |
| from tqdm import tqdm | |
| import pandas as pd | |
| raw = rdpcap(mypcap.pcap) | |
| ip_data = [] | |
| tcp_data = [] | |
| for frame in tqdm(raw, desc='Converting'): | |
| if 'options' in frame['IP'].fields: del frame['IP'].fields['options'] |
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
| """Read pdf files and extract tabular data.""" | |
| from tabula import read_pdf | |
| def file_to_dataframe(file_path): | |
| """Read and save tables from pdf.""" | |
| tables = read_pdf(file_path, multiple_tables=True) | |
| # extract and format potency table | |
| potency_table = tables[0] | |
| potency_table = potency_table.drop(potency_table.index[[0, 1]]) |
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
| """Save pdf files from lab website.""" | |
| from bs4 import BeautifulSoup | |
| from bs4.dammit import EncodingDetector | |
| import requests | |
| from tqdm import tqdm | |
| # connect to the webpage | |
| url = 'https://forwardgro.com/testresults/' | |
| resp = requests.get(url) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 numpy as np | |
| from keras.datasets import mnist | |
| from keras.layers import Input, Dense, Reshape, Flatten, Dropout | |
| from keras.layers import BatchNormalization | |
| from keras.layers.advanced_activations import LeakyReLU | |
| from keras.models import Sequential | |
| from keras.optimizers import Adam | |
| from logger import logger | |
| import matplotlib.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
| import numpy as np | |
| import pandas as pd | |
| import requests | |
| from sklearn.linear_model import BayesianRidge | |
| #load market data | |
| market_data = get_market_data('BTC/USD') | |
| #shift target variable one day back | |
| #in order to train model to predict one day into future |