I have a file(say temp.rule) which looks like below:
11,12,13,14,0,0.55
27,28,29,30,1,0.67
31,32,33,34,1,0.84
75,76,77,78,3,0.51
51,52,53,54,2,0.28
55,56,57,58,2,0.77
59,60,61,62,2,0.39
35,36,37,38,1,0.45
39,40,41,42,1,0.82
43,44,45,46,1,0.92
63,64,65,66,2,0.41
90,91,92,93,3,0.97
The 1st 4 columns are attribute columns and the last 2 rows are class and fitness. I tried to read this as:
df = pd.read_csv('temp.rule', names=['att1','att2','att3','att4','class','fitness'])
But this can have multiple column values for attributes, that is there can be a file say temp_1.rule which can have 6 attributes. The last 2 columns will always be class and fitness. How to make that thing dynamic instead of names=['att1','att2','att3','att4'...]