Commit cb64b75b authored by Mitchell Moore's avatar Mitchell Moore
Browse files

Merge branch 'feat-data-visualization' into 'master'

Feat data visualization

See merge request !4
parents fd320901 7438388b
%% Cell type:code id: tags:
``` python
import globus_sdk
import matplotlib.pyplot as plt
import numpy as np
import csv
import pandas as pd
from datetime import datetime, timedelta
from mpl_toolkits.mplot3d import Axes3D
```
%% Cell type:code id: tags:
``` python
""" Read Files into DataFrame objects """
data = pd.read_csv("test.csv") # reads comma delimited file into a DataFrame object
off_campus = pd.read_csv("offcampus_data.csv")
on_campus = pd.read_csv("oncampus_data.csv")
data.head(16) # returns the first n rows of the DataFrame, n here is 16
```
%% Cell type:code id: tags:
``` python
""" Builds a 3D plot based on the elapsed time values using pandas and matplotlib """
# plot
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(111, projection='3d')
ax.scatter(range(len(data['Dataset'])), data['Speed'],(pd.to_datetime(data['End'], infer_datetime_format=True) - pd.to_datetime(data['Start'], infer_datetime_format=True)).dt.total_seconds() / 60, c='navy', s=60)
ax.set(xticks=range(len(data['Dataset'])), xticklabels=data['Dataset'])
plt.xticks(rotation=45)
plt.show()
```
%% Cell type:code id: tags:
``` python
""" Builds bar graphs to represent transfer speeds for different datasets """
#plot
bg1 = data.plot.bar(x = 'Dataset', y = 'Speed', rot = 100) # graph shows the speed for each ds
```
%% Cell type:code id: tags:
``` python
""" Builds bar graphs to represent data for different endpoints """
"""
#time = (pd.to_datetime(data['End'], infer_datetime_format=True) - pd.to_datetime(data['Start']
bg2 = data.plot.bar(x = "Dataset",
y = (pd.to_datetime(data['End'],
infer_datetime_format=True) - pd.to_datetime(data['Start'])),
rot=100)
"""
```
%% Cell type:code id: tags:
``` python
""" Builds scatter plots to represent transfer speeds for different datasets """
plt.scatter((data['Dataset']), data['Speed'])
plt.title('Dataset Speed')
plt.xlabel('Dataset')
plt.ylabel('Speed')
plt.show()
color = ["r","r","g","r","r","g","r","r","r","g"]
df = pd.DataFrame( {"frequency" : frequency, "color" : color})
df.sort_values("frequency", inplace=True)
plt.scatter(x=range(len(df)), y= df["frequency"], c = df["color"])
plt.show()
```
%% Cell type:code id: tags:
``` python
```
Dataset,Start,End,Elapsed,Speed,Source EP ID,Dest. EP ID,Task ID
ds01,2020-12-07T19:04:00+00:00,2020-12-07T19:04:16+00:00,0:00:15.649794,6.2,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,f6d78aea-38be-11eb-b54c-02d9497ca481
ds04,2020-12-07T19:04:16+00:00,2020-12-07T19:04:38+00:00,0:00:22.362818,435.8,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,004d4114-38bf-11eb-b54c-02d9497ca481
ds06,2020-12-07T19:04:39+00:00,2020-12-07T19:07:35+00:00,0:02:56.737719,541.78,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,0dc11c1c-38bf-11eb-b54c-02d9497ca481
ds08,2020-12-07T19:07:36+00:00,2020-12-07T19:33:48+00:00,0:26:12.164036,623.74,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,7744da48-38bf-11eb-8fda-0a34088e79f9
ds10,2020-12-07T19:33:48+00:00,2020-12-07T19:58:07+00:00,0:24:19.393502,653.56,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,207e94fc-38c3-11eb-b54c-02d9497ca481
ds12,2020-12-07T19:58:08+00:00,2020-12-07T20:02:37+00:00,0:04:29.252750,354.59,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,86838570-38c6-11eb-b54c-02d9497ca481
ds14,2020-12-07T20:02:37+00:00,2020-12-07T22:04:34+00:00,2:01:56.402703,651.76,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,27278c60-38c7-11eb-8fda-0a34088e79f9
ds16,2020-12-07T22:04:34+00:00,2020-12-07T22:29:09+00:00,0:24:35.451178,646.54,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,304766f6-38d8-11eb-8fda-0a34088e79f9
ds01,2020-12-07T22:29:10+00:00,2020-12-07T22:30:00+00:00,0:00:50.253062,1.91,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9fe93c0c-38db-11eb-b172-0ee0d5d9299f
ds04,2020-12-07T22:30:00+00:00,2020-12-07T22:31:06+00:00,0:01:05.586937,145.62,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,be147962-38db-11eb-8fda-0a34088e79f9
ds06,2020-12-07T22:31:06+00:00,2020-12-07T22:42:01+00:00,0:10:54.475253,145.74,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,e549c212-38db-11eb-b172-0ee0d5d9299f
ds08,2020-12-07T22:42:01+00:00,2020-12-07T23:11:34+00:00,0:29:32.878643,553.16,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,6b8f3126-38dd-11eb-b54c-02d9497ca481
ds10,2020-12-07T23:11:34+00:00,2020-12-07T23:31:06+00:00,0:19:32.293011,813.66,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,8c6e47e8-38e1-11eb-8fda-0a34088e79f9
ds12,2020-12-07T23:31:07+00:00,2020-12-07T23:37:48+00:00,0:06:42.244586,237.33,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,474a776a-38e4-11eb-b54c-02d9497ca481
ds14,2020-12-07T23:37:49+00:00,2020-12-08T01:10:30+00:00,1:32:41.139863,857.48,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,372c235a-38e5-11eb-b54c-02d9497ca481
ds16,2020-12-08T01:10:31+00:00,2020-12-08T01:29:20+00:00,0:18:50.345585,844.24,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,2a086d20-38f2-11eb-8fda-0a34088e79f9
This diff is collapsed.
Dataset,Start,End,Elapsed,Speed,Source EP ID,Dest. EP ID,Task ID
ds01,2020-12-15T03:16:17+00:00,2020-12-15T03:16:31+00:00,0:00:13.948828,6.83,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,e4db46d6-3e83-11eb-b559-02d9497ca481
ds04,2020-12-15T03:16:31+00:00,2020-12-15T03:16:54+00:00,0:00:23.533417,411.39,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,ed4bfb80-3e83-11eb-b559-02d9497ca481
ds06,2020-12-15T03:16:55+00:00,2020-12-15T03:20:09+00:00,0:03:13.832365,491.98,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,fb776488-3e83-11eb-b559-02d9497ca481
ds08,2020-12-15T03:20:09+00:00,2020-12-15T03:46:26+00:00,0:26:17.256435,621.78,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,6f31a0c8-3e84-11eb-b181-0ee0d5d9299f
ds10,2020-12-15T03:46:26+00:00,2020-12-15T04:10:47+00:00,0:24:20.822792,653.01,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,1b813fca-3e88-11eb-b181-0ee0d5d9299f
ds12,2020-12-15T04:10:48+00:00,2020-12-15T04:15:05+00:00,0:04:17.624449,370.59,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,8264d6a4-3e8b-11eb-b181-0ee0d5d9299f
ds14,2020-12-15T04:15:05+00:00,2020-12-15T06:16:39+00:00,2:01:33.838759,653.78,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,1c2106b4-3e8c-11eb-b559-02d9497ca481
ds16,2020-12-15T06:16:40+00:00,2020-12-15T06:41:04+00:00,0:24:24.777208,651.11,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,17bfb12c-3e9d-11eb-8fed-0a34088e79f9
ds01,2020-12-15T06:41:05+00:00,2020-12-15T06:42:00+00:00,0:00:55.646277,1.72,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,80f7d874-3ea0-11eb-b55a-02d9497ca481
ds04,2020-12-15T06:42:01+00:00,2020-12-15T06:43:17+00:00,0:01:16.523024,124.72,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,a24ffb50-3ea0-11eb-b181-0ee0d5d9299f
ds06,2020-12-15T06:43:17+00:00,2020-12-15T06:55:09+00:00,0:11:51.650864,134.02,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,d016558e-3ea0-11eb-8fed-0a34088e79f9
ds08,2020-12-15T06:55:10+00:00,2020-12-15T07:24:12+00:00,0:29:02.395196,562.91,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,78b4979a-3ea2-11eb-8fed-0a34088e79f9
ds10,2020-12-15T07:24:12+00:00,2020-12-15T07:42:51+00:00,0:18:39.433732,852.25,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,875e8054-3ea6-11eb-b181-0ee0d5d9299f
ds12,2020-12-15T07:42:52+00:00,2020-12-15T07:46:44+00:00,0:03:51.911249,411.61,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,22c29268-3ea9-11eb-b55a-02d9497ca481
ds14,2020-12-15T07:46:44+00:00,2020-12-15T09:18:32+00:00,1:31:48.073656,865.71,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,ad263f54-3ea9-11eb-8fed-0a34088e79f9
ds16,2020-12-15T09:18:33+00:00,2020-12-15T09:37:00+00:00,0:18:27.738857,861.28,9c8c88c2-ea4a-11e6-b9ba-22000b9a448b,606579ae-5b03-11e9-bf32-0edbf3a4e7ee,80563d82-3eb6-11eb-b55a-02d9497ca481
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment