-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
52 lines (43 loc) · 1.49 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin python3
# Contributors: vipa | Datura Data Group
########################################################
# Testing for User Imports
try:
import pandas as pd
import time
import matplotlib.pyplot as plt
import sys
import subprocess
except ImportError:
print('''[-] Manually installing required modules...\n
[-] This can also be performed via command 'python3 -m pip install -r requirements' within your terminal!''')
subprocess.check_call([sys.executable, "-m", "pip", "install", 'pandas'])
subprocess.check_call([sys.executable, "-m", "pip", "install", 'time'])
subprocess.check_call([sys.executable, "-m", "pip", "install", 'matplotlib.pyplot'])
subprocess.check_call([sys.executable, "-m", "pip", "install", 'sys'])
subprocess.check_call([sys.executable, "-m", "pip", "install", 'subprocess'])
pass
finally:
print("[-] Requirements have been installed!")
pass
# Globals
user_input = input("Filename:\t")
if ".csv" in user_input:
file = user_input
else:
file = user_input + ".csv"
# Main Function
def main(file):
try:
# Pandas CSV Interpreter | Display
print("[-] Analyzing data set...")
df = pd.read_csv(file)
df.dropna(inplace=True)
print(df.to_string())
df.plot() # Formatting to process matlib graph
plt.show() # Matlib graph
except SyntaxError as e:
print("[!] SYNTAX ERROR - EXITING... Read the docs. SMH.")
time.sleep(3)
exit()
main(file)