Jun-30-2022, 01:11 PM
(This post was last modified: Jun-30-2022, 01:24 PM by Led_Zeppelin.)
I have spent a day is trying to get the following code to work.
It fails with a statement that there is an error is line 5. The error reads
What is going on here?
I just want the dataframe to look like this.
with the headings in place and of course the numerical columns normalized and scaled.
But I keep getting this error.
What is wrong?
Any help appreciated.
Respectfully,
LZ
1 2 3 4 5 6 |
df2 = pd.DataFrame(df, columns = [ 'sensor_00' , 'sensor_01' , 'sensor_02' , 'sensor_03' , 'sensor_04' , 'sensor_05' , 'sensor_06' , \ 'sensor_07' , 'sensor_08' , 'sensor_09' , 'sensor_10' , 'sensor_11' , 'sensor_12' , 'sensor_13' , 'sensor_14' , 'sensor_15' , \ 'sensor_16' , 'sensor_17' , 'sensor_18' , 'sensor_19' , 'sensor_20' , 'sensor_21' , 'sensor_22' , 'sensor_23' , 'sensor_24' , \ 'sensor_25' , 'sensor_26' , 'sensor_27' , 'sensor_28' , 'sensor_29' , 'sensor_30' , 'sensor_31' , 'sensor_32' , 'sensor_33' , \ 'sensor_34' , 'sensor_35' , 'sensor_36' , 'sensor_37' , 'sensor_38' , 'sensor_39' , 'sensor_40' , 'sensor_41' , 'sensor_42' , \ 'sensor_43' , 'sensor_44' , 'sensor_45' , 'sensor_46' , 'sensor_47' , 'sensor_48' , 'sensor_49' , 'sensor_50' , 'sensor_51' ]) |
Error:Input In [13]
'sensor_34', 'sensor_35', 'sensor_36', 'sensor_37', 'sensor_38', 'sensor_39', 'sensor_40', 'sensor_41', 'sensor_42', \
^
SyntaxError: unexpected character after line continuation character
Now there is nothing that I can see that is after line continuation character. But the error says there is.What is going on here?
I just want the dataframe to look like this.
1 2 3 4 5 6 |
Unnamed: 0 sensor_00 sensor_01 sensor_02 sensor_03 sensor_04 sensor_05 sensor_06 sensor_07 sensor_08 ... sensor_42 sensor_43 sensor_44 sensor_45 sensor_46 sensor_47 sensor_48 sensor_49 sensor_50 sensor_51 0 0 2.465394 47.09201 53.2118 46.310760 634.3750 76.45975 13.41146 16.13136 15.56713 ... 31.770832 41.92708 39.641200 65.68287 50.92593 38.194440 157.9861 67.70834 243.0556 201.3889 1 1 2.465394 47.09201 53.2118 46.310760 634.3750 76.45975 13.41146 16.13136 15.56713 ... 31.770832 41.92708 39.641200 65.68287 50.92593 38.194440 157.9861 67.70834 243.0556 201.3889 2 2 2.444734 47.35243 53.2118 46.397570 638.8889 73.54598 13.32465 16.03733 15.61777 ... 31.770830 41.66666 39.351852 65.39352 51.21528 38.194443 155.9606 67.12963 241.3194 203.7037 3 3 2.460474 47.09201 53.1684 46.397568 628.1250 76.98898 13.31742 16.24711 15.69734 ... 31.510420 40.88541 39.062500 64.81481 51.21528 38.194440 155.9606 66.84028 240.4514 203.1250 4 4 2.445718 47.13541 53.2118 46.397568 636.4583 76.58897 13.35359 16.21094 15.69734 ... 31.510420 41.40625 38.773150 65.10416 51.79398 38.773150 158.2755 66.55093 242.1875 201.3889 |
But I keep getting this error.
What is wrong?
Any help appreciated.
Respectfully,
LZ