-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
197 lines (175 loc) · 6.73 KB
/
index.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import os
import time
import sys
import plot
import statistics
import prediction
import find_file
print('\n')
print("Checking If packages are installed or not")
try:
import matplotlib
matplotlib.use("TKAgg")
import matplotlib.pyplot as plt
import pandas as pd
from pyautogui import prompt,confirm,alert
except ImportError:
packages_ask = input('''Packages Not Found.
Would you like to install them? (y/n)''')
if packages_ask == 'y':
# PACKAGES INSTALLATION PROCESS BEGIN
# installing pip
print('\n')
print('Checking if pip is installed or not')
os.system('python -m pip install --upgrade pip')
print("Installing packages .......")
print(''' __ __ _ _____ ____ _ ___ _____ _ ___ ____
| \/ | / \|_ _| _ \| | / _ \_ _| | |_ _| __ )
| |\/| | / _ \ | | | |_) | | | | | || | | | | || _ \
| | | |/ ___ \| | | __/| |__| |_| || | | |___ | || |_) |
|_| |_/_/ \_\_| |_| |_____\___/ |_| |_____|___|____/
''')
os.system('pip install matplotlib')
print("matplotlib installed")
print('''
____ _ _ _ ____ _ ____
| _ \ / \ | \ | | _ \ / \ / ___|
| |_) / _ \ | \| | | | |/ _ \ \___ \
| __/ ___ \| |\ | |_| / ___ \ ___) |
|_| /_/ \_\_| \_|____/_/ \_\____/
''')
os.system('pip install pandas')
print("pandas installed")
print(''' ______ __ _ _ _ _____ ___ ____ _ _ ___
| _ \ \ / // \ | | | |_ _/ _ \ / ___| | | |_ _|
| |_) \ V // _ \| | | | | || | | | | _| | | || |
| __/ | |/ ___ \ |_| | | || |_| | |_| | |_| || |
|_| |_/_/ \_\___/ |_| \___/ \____|\___/|___|
''')
os.system('pip install pyautogui')
print("pyautogui installed")
print('''
____ _ ___ _____ _ ____ _ _
/ ___|| |/ / | | ____| / \ | _ \| \ | |
\___ \| ' /| | | _| / _ \ | |_) | \| |
___) | . \| |___| |___ / ___ \| _ <| |\ |
|____/|_|\_\_____|_____/_/ \_\_| \_\_| \_|
''')
os.system('pip install sklearn')
print("sklearn installed")
print("Packages installed :)")
# PACKAGES INSTALLAYTION PROCESS END
# RE-CHECKING IF PACKAGES ARE INSTALLED OR NOT
print("Checking If packages are installed or not")
try:
import matplotlib
matplotlib.use("TKAgg")
import matplotlib.pyplot as plt
import pandas as pd
from pyautogui import prompt,confirm,alert
# IF ERROR IS RAISED, THEN RE-CHECK PACKAGES
except ImportError:
print("Sorry some error occured while installing Packages \n Try installing manually")
print("Exiting")
exit()
# IF ANSWER IS NO THEN EXIT
else:
print("IF YOU WANT TO RUN THE PROGRAM \n YOU SHOULD HAVE PACKAGES INSTALLED PLEASE RELAUNCH THIS PROGRAM TO INSTALL PACKAGES OR INSTALL IT MANUALLY")
exit()
# clear screen
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
# clear screen
clear_screen()
# start
print("Welcome To ")
print("\n")
print("\n")
print(''' _ _ ____ _ _ __ __ _
/ \ _ _| |_ ___ | _ \| | ___ | |_ | \/ | __ _| | _____ _ __
/ _ \| | | | __/ _ \ | |_) | |/ _ \| __| | |\/| |/ _` | |/ / _ \ '__|
/ ___ \ |_| | || (_) | | __/| | (_) | |_ | | | | (_| | < __/ |
/_/ \_\__,_|\__\___/ |_| |_|\___/ \__| |_| |_|\__,_|_|\_\___|_|
_ _ ____ _ _ _
/ \ _ __ __| | | _ \ _ __ ___ __| (_) ___| |_ ___ _ __
/ _ \ | '_ \ / _` | | |_) | '__/ _ \/ _` | |/ __| __/ _ \| '__|
/ ___ \| | | | (_| | | __/| | | __/ (_| | | (__| || (_) | |
/_/ \_\_| |_|\__,_| |_| |_| \___|\__,_|_|\___|\__\___/|_|
Developed By: Binayak Jha
(note: still in development you can also contribute in this project by adding new features and giving your feedback)
''')
print('Starting .....')
print('\n')
data_input = input('Please keep your csv file name (include .csv) here (note: do not give a path or anything else we will find the file itself :) = ')
print('Searching Please wait ....')
# print(find_files("canada_predicted_csv.csv","/")[0])
a = find_file.find_files(data_input,"/")[0]
print("\n")
print('FILE FOUND !!')
print("\n")
print(a)
print("\n")
# asking values start
X = input('[?] please enter the data table heading which you want to show in x axis = ')
print('X = '+ str(X))
print("\n")
y = input('[?] please enter the data table heading which you want to show in y axis = ' )
print('Y = '+ str(y))
print("\n")
x_label = str(input('[?] please enter the data table heading which you want to show in x axis = '))
print('X label = '+ str(x_label))
print("\n")
y_label = str(input('[?] please enter the data table heading which you want to show in y axis = '))
print('Y label = '+ str(y_label))
print("\n")
heading = str(input('[?] please enter the data table heading which you want to show in graph = '))
print('Heading = '+ str(heading))
print("\n")
# asking values end
plt.title(heading)
df = pd.read_csv(a)
# Plot Module
plot.plot(df,X,y,x_label,y_label,heading)
# Plot Module END
print("\n")
print("\n")
print("\n")
print('''
__ __ _ _____ _ _ ____
| \/ | / \|_ _| | | / ___|
| |\/| | / _ \ | | | |_| \___ \
| | | |/ ___ \| | | _ |___) |
|_| |_/_/ \_\_| |_| |_|____/
''')
print("\n")
ask = str(input( ' Do you want to see mean and other things? (y/n) '))
if ask == 'y' or ask == 'Y' or ask == 'yes' or ask == 'Yes':
statistics.math(df,y)
print
elif ask == 'n' or ask == 'N' or ask == 'no' or ask == 'No':
pass
#PREDICTION
print("\n")
print('''
____ ____ _____ ____ ___ ____ _____ ___ ___ _ _
| _ \| _ \| ____| _ \_ _/ ___|_ _|_ _/ _ \| \ | |
| |_) | |_) | _| | | | | | | | | | | | | | \| |
| __/| _ <| |___| |_| | | |___ | | | | |_| | |\ |
|_| |_| \_\_____|____/___\____| |_| |___\___/|_| \_|
''')
print("\n")
predict_ask = input('Do you want to predict? (y/n) ')
if predict_ask == 'y' or predict_ask == 'Y' or predict_ask == 'yes' or predict_ask == 'Yes':
prediction.predicts(df,X,y,x_label,y_label)
elif predict_ask == 'n' or predict_ask == 'N' or predict_ask == 'no' or predict_ask == 'No':
print('Thank you for using this program')
print("\n")
print('Graph ....')
print('''
_____ _ _ ____
| ____| \ | | _ \
| _| | \| | | | |
| |___| |\ | |_| |
|_____|_| \_|____/
''')
print("\n")