Automation

  • Thread starter Renato Barbosa Pim Pereira
  • Start date
R

Renato Barbosa Pim Pereira

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.
 
D

Denis McMahon

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.
 
D

Denis McMahon

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.
 
R

Rick Johnson

Seems to me like you're using a sledgehammer to shell a peanut.

And hopefully he knows whether or not he has a peanut allergy
before he commits to enjoying the fruits of his labor.
 
M

Mark Lawrence

I apologize again for my bad english and any inconvenience that I have generated.

I do wish that people would stop apologising for poor English, it's an
extremely difficult language. IIRC there are eight different ways of
pronouncing the vowel combination au. Whatever happened to "There
should be one-- and preferably only one --obvious way to do it."? :)
 
S

Steven D'Aprano

As a native of England I have to agree it is far to arrogant to expect
everyone else to be able to speak good English when I can barley order a
beer in any other language. (even or especially in the USA)

Apparently you can "barley" write UK English either :)

No offence intended, I just thought that was an amusing error to make.
The word you're after is "barely", barley is a grain similar to wheat or
oats. Also "far too arrogant".

But yes, English is a tricky language. Who would imagine that "ghoti"
could legitimately be pronounced "fish"?

"gh" sounds like F, as in "enough" (enuf)

"o" sounds like I, as in "women" (wimmin)

"ti" sounds like SH, as in "station" (stayshun)
 
P

Paul Rudin

Steven D'Aprano said:
A few minor errors is one thing, but when you see people whose posts are
full of error after error and an apparent inability to get English syntax
right, you have to wonder how on earth they expect to be a programmer?

The irritating thing is apparent lack of care. A post is written once
and will be seen (perhaps not read) by many people. People post with the
intention of others reading their words. If they can't be bothered to
take a little care in writing, why should we spend time reading?
 
G

Grant Edwards

I do wish that people would stop apologising for poor English, it's an
extremely difficult language.

It's certainly not necessary from anybody for whom English is not a
first language -- and that's usually pretty easy to guess based on
domains and personal names.

There are people (not many in this group) who grew up speaking English
and really ought to apologize for their writing -- but they never do.

So a good rule of thumb is:

If you think maybe you need to apologize for your English, you don't

If it never occurred to you that you need to apologize, you might.

;)
 
G

Grant Edwards

The irritating thing is apparent lack of care. A post is written once
and will be seen (perhaps not read) by many people. People post with the
intention of others reading their words. If they can't be bothered to
take a little care in writing, why should we spend time reading?

Just because English is your second language it doesn't mean you don't
need to pay attention to what keys you're hitting and proof-read a
posting before hitting "send".

And yes, people can _easily_ tell the difference between errors caused
by being lazy/sloppy and errors caused by writing in a second
language.
 
C

Chris Angelico

And yes, people can _easily_ tell the difference between errors caused
by being lazy/sloppy and errors caused by writing in a second
language.

Yes, and even among people for whom English is the first language,
idioms can cause offense. On another list I'm on (Savoynet), one
person got somewhat offended at someone apparently calling him
completely ignorant, when actually no such slight was intended.
Welcome to English, where we all use the same words (mostly) but you
really need to be careful talking about knocking someone up...

ChrisA
 
D

Dennis Lee Bieber

dyslexia, being Foreign *wink*, or even broken keyboard. ("Nw kyboard is
on ordr, pls xcus my lack of lttr aftr D and b4 F.")

On a windowing system, even that excuse may not suffice.

Find some file with the bad character, highlight it, copy to
clip-board. Now when you need to enter the character, you just paste it
into the document (using the keyboard shortcut, not a mouse context menu)
 
T

Tim Chase

Can you supply an example of the form such an apology might take?

"I'm sorry that, despite growing up steeped in the language, I can't
manage to put together two coherent thoughts or practically apply any
of the spelling/grammar/punctuation/capitalization lessons provided
at no cost to me throughout 12+ years of academic instruction."

Harumph. Non-native speakers get my extensive compassion--English
really is a nutso language, and any attempt to use it for
communicating should be lauded in the face of that challenge.
However, native speakers have a higher bar, IHMO.

-tkc
 
D

Dennis Lee Bieber

"I'm sorry that, despite growing up steeped in the language, I can't
manage to put together two coherent thoughts or practically apply any
of the spelling/grammar/punctuation/capitalization lessons provided
at no cost to me throughout 12+ years of academic instruction."

Harumph. Non-native speakers get my extensive compassion--English
really is a nutso language, and any attempt to use it for
communicating should be lauded in the face of that challenge.
However, native speakers have a higher bar, IHMO.

Given that "English" contains remnants of latin (from the Roman
occupation), saxons (a germanic tribe), angles (another germanic tribe),
danish (after the joining of the anglo-saxon), other vikings (norse), then
the norman invasion (which was a mix of norse and old french), etc. -- the
overlapping of orthographic elements is no surprise.

Oh, and add in the Great Vowel Shift
http://en.wikipedia.org/wiki/Great_Vowel_Shift

At least we don't (nominally) have the situation of Mandarin vs
Cantonese (in which the spoken languages are quite different, but the
written pictographs are common, as I recall) [No... Instead we get the
different occidental phonemes for Chinese [and nearby]: Peking vs Beijing;
[nearby] Bombay vs Mumbai...]
 
R

Roy Smith

William Ray Wing said:
And my personal peeve - using it's (contraction) when its (possessive)
should have been used; occasionally vice-versa.

And one of mine is when people write, "Here, here!" to signify
agreement. What they really mean to write is, "Hear, hear!", meaning,
"Listen to what that person said".
 
P

Paul Smith

And one of mine is when people write, "Here, here!" to signify
agreement. What they really mean to write is, "Hear, hear!", meaning,
"Listen to what that person said".

The one that really irks me is people using "loose" when they mean
"lose". These words are not related, and they don't sound the same.
Plus this mistake is very common; I typically see it at least once a
day.
 
A

Andrew Berg

The one that really irks me is people using "loose" when they mean
"lose". These words are not related, and they don't sound the same.
Plus this mistake is very common; I typically see it at least once a
day.
Don't be surprised if such people pronounce them the same; a lot of such errors are caused by learning incorrect pronunciation.
For example, people often write 'should of' because that is what they hear (and what they end up saying).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top