Created
May 15, 2018 09:33
-
-
Save starhopp3r/de577d55895989067cd91a729c00e4d2 to your computer and use it in GitHub Desktop.
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 | |
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
# Read cols | |
cols = cols = [1, 2, 3, 4, 7, 10] | |
# Training data | |
training_file = "training_data.csv" | |
# Read CSV | |
data = pd.read_csv(training_file, low_memory=False, usecols=cols) | |
# Get the parameters | |
# Only get the first 500 data points | |
p = 500 | |
# Get each column | |
wind_speed = data.loc[data['breakdown'] == 1][:p] # 1 | |
rpm_blade = data.loc[data['breakdown'] == 1][:p] # 2 | |
oil_temp = data.loc[data['breakdown'] == 1][:p] # 3 | |
oil_level = data.loc[data['breakdown'] == 1][:p] # 4 | |
vib_freq = data.loc[data['breakdown'] == 1][:p] # 7 | |
# Plot the graph | |
fig = plt.figure() | |
# Project the graph in 3D | |
ax = fig.add_subplot(111, projection='3d') | |
# Scatter graph with red colored points | |
ax.scatter(wind_speed, rpm_blade, oil_temp, c='r') | |
# Labels for the graph | |
ax.set_xlabel('Wind Speed') | |
ax.set_ylabel('RPM Blade') | |
ax.set_zlabel('Oil Temperature') | |
# Show the graph | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment