-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataframe.py
38 lines (29 loc) · 1.08 KB
/
dataframe.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
import pandas as pd
import CNN
def get_data_of_bearings(class_number):
dataframe = pd.read_excel('description_of_data.xlsx')
with pd.option_context('display.max_rows', None, 'display.max_columns', None):
print(dataframe)
list_of_rows = dataframe.values.tolist()
axial_force = 0
radial_force = 0
revolutions = 0
for each in list_of_rows:
if int(class_number) in each:
axial_force, radial_force = each[0], each[1]
for i in range(2, 9):
if i != 2:
df1 = dataframe[['Unnamed: ' + str(i)]]
else:
df1 = dataframe[['Revolutions per minute']]
list_of_columns = df1.values.tolist()
for each in list_of_columns:
if int(class_number) == each[0]:
a = df1.iloc[0]
a = a.values.tolist()
revolutions = a[0]
print("Spectrogram data is:")
print("Axial force = {}, Radial force = {}, Revolutions = {}".format(axial_force, radial_force, revolutions))
return revolutions
# # df_test = dataframe[['Unnamed: 2']]
# # print(df_test)