Last active
May 31, 2019 19:20
-
-
Save iamsurya/f98c0469ec87af290ca4343121d57a36 to your computer and use it in GitHub Desktop.
Keras2TF Example Preamble
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
# imports | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Load the data | |
df = pd.read_csv("slope-lownoise.txt", sep='\t', header=None) | |
labels = np.asarray(df[0]).reshape((len(df[0]),-1)) | |
data = np.asarray(df.iloc[:,1:]) | |
# Check data | |
print(labels.shape) | |
print(data.shape) | |
# Normalize segments | |
normdata = np.empty_like(data).astype('float64') | |
for row in range(len(data)): | |
normdata[row] = (data[row] - min(data[row])) / (max(data[row]) - min(data[row])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment