To achieve according to the existing three column col1, col2, col3 do simple division after additional new generated columns and three columns col1_new, col2_new col3_new, code to run, has been an error TypeError: unsupported operand type (s) for/: 'object' and '& lt; The class 'int' & gt; '
The following code snippet,
Def func_process (file_in file_out) :
Df=pd read_csv (file_in)
Df. Eval (" "" col1_new=col1/2
Col2_new=col2/4
Col3_new=col3/8
""," inplace=True)
Df. To_csv (file_out, encoding="utf-8", the index=False)
If __name__=="__main__ ':
Input_file='C:/temp/CSV/in/'
Output_file='C:/temp/CSV out/'
Consult everybody need how to change? Thank you very much!