Automation

Denis McMahon denismfmcmahon at gmail.com
Mon Nov 4 12:39:03 CET 2013


On Sun, 03 Nov 2013 23:32:46 +0000, Denis McMahon wrote:

> On Sun, 03 Nov 2013 14:19:48 -0200, Renato Barbosa Pim Pereira wrote:
> 
>> I have one .xls file with the values of PV MV and SP, I wanna to
>> calculate Kp Ki Kd with python from this file, can anyone give me any
>> suggestion about how can I do this? From now, thanks.
> 
> Why use Python? Why not simply write excel to do the calculations?
> 
> Assuming PV, MV and SP are in columns, you simply need to write your
> equations for Kp, Ki and Kd so that they reference the relevant columns,
> and then past them down the whole spreadsheet.
> 
> Seems to me like you're using a sledgehammer to shell a peanut.

For some reason OP is now continuing the conversation with my by email 
and adding me to his social networks.

To the OP - observation - in the original post you said .xls file, 
not .csv file. If your data is in .csv format, you should have said so, 
not called it an .xls file.

If you ant to convert your .csv containing columns a, b and c into a .csv 
containing columns a, b, c, x, y and z, then the solution is to read your 
existing .csv file one line at a time, calculate the extra values x, y 
and z, and then write the 6 values to a new file.

You might want to delete the old file and rename the new one to the old 
name when you finish, that might be part of the implementation 
requirements.

-- 
Denis McMahon, denismfmcmahon at gmail.com



More information about the Python-list mailing list