From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Leech-Pepin Subject: Re: searching for csv utilities Date: Wed, 3 Jun 2015 12:38:37 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11409ac00e444405179fb2f3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Bgy-00058L-Ry for emacs-orgmode@gnu.org; Wed, 03 Jun 2015 12:39:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0Bgw-0006kT-Tu for emacs-orgmode@gnu.org; Wed, 03 Jun 2015 12:39:00 -0400 Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]:35711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Bgw-0006kE-OC for emacs-orgmode@gnu.org; Wed, 03 Jun 2015 12:38:58 -0400 Received: by qgg60 with SMTP id 60so6235883qgg.2 for ; Wed, 03 Jun 2015 09:38:58 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jude DaShiell Cc: Org Mode Mailing List --001a11409ac00e444405179fb2f3 Content-Type: text/plain; charset=UTF-8 On 3 June 2015 at 12:07, Jude DaShiell wrote: > This is a piece of a modified ecm that may show what's going on. > > cut here. > |----------------------+---------+--------+--------+--------| > | Averages: | | | | | > | Counts: | | | | | > | Maximums: | | | | | > | Medians: | | | | | > | Minimums: | | | | | > | Modes: | | | | | > | Standard Deviations: | | | | | > | Sums: | 108.69) | 70.45) | 66.62) | 92.93) | > |----------------------+---------+--------+--------+--------| > #+TBLFM: @>$2..@>$>=vmean(@I..@>>;%.2f) > > I haven't even attempted the rest of the math since I have no way to > predict where any of the results will land. > @> means last line, @>> is second to last, @>>> third to last and so on. So for 7th from the bottom it would be @>>>>>>>. Re: PrintF specification Everything after the =;= is considered part of the specification, so the =)= used to close the vmean is actually part of the specification. Changing that to =vmean();%.2f= will correct it. For your sample ECM (plus original data and one sample line to actually confirm median works) you would work with the following (Apologies for the very long TBLFM line): I was unable to find a built-in to determine the mode. I've found sample functions on Stack Overflow that would calculate it based on a list, but I'm not familiar enough with Org-Table format on how to go from cell references =@I..@II= to a list of values for the sake of manipulating them. : | Date | Sys | Dia | Pul | Sugar | : |----------------------+--------+--------+--------+--------| : | [2014-04-27 Sun] | 125 | 88 | 78 | 92 | : | [2014-04-28 Mon] | 102 | 88 | 86 | 92 | : | [2014-04-29 Tue] | 115 | 88 | 85 | 95 | : |----------------------+--------+--------+--------+--------| : | Averages: | 114.00 | 88.00 | 83.00 | 93.00 | : | Counts: | 3.00 | 3.00 | 3.00 | 3.00 | : | Maximums: | 125.00 | 88.00 | 86.00 | 95.00 | : | Medians: | 115.00 | 88.00 | 85.00 | 92.00 | : | Minimums: | 102.00 | 88.00 | 78.00 | 92.00 | : | Modes: | | | | | : | Standard Deviations: | 11.53 | 0.00 | 4.36 | 1.73 | : | Sums: | 342.00 | 264.00 | 249.00 | 279.00 | : |----------------------+--------+--------+--------+--------| : #+TBLFM: @>$2..@>$>=vsum(@I..@II);%.2f::@>>$2..@>>$>=vsdev(@I..@II );%.2f::@>>>>$2..@>>>>$>=vmin(@I..@II);%.2f::@>>>>>$2..@ >>>>>$>=vmedian(@I..@II);%.2f::@>>>>>>$2..@>>>>>>$>=vmax(@I..@II);%.2f::@ >>>>>>>$2..@>>>>>>>$>=vcount(@I..@II);%.2f::@>>>>>>>>$2..@ >>>>>>>>$>=vmean(@I..@II);%.2f Regards, Jonathan On Tue, 2 Jun 2015, Jonathan Leech-Pepin wrote: > > Date: Tue, 2 Jun 2015 08:04:20 >> From: Jonathan Leech-Pepin >> To: Jude DaShiell >> Cc: Org Mode Mailing List >> Subject: Re: [O] searching for csv utilities >> >> Hello, >> >> On 2 June 2015 at 07:44, Jude DaShiell wrote: >> >> | Date | Sys | Dia | Pul | Sugar | >>> |------------------+-------------------+-----+-----+-------| >>> | [2014-04-27 Sun] | 125 | 88 | 78 | 92 | >>> | [2014-04-28 Mon] | 102 | 88 | 86 | 92 | >>> | Averages: | =$2=vmean(@<..@>) | | | | >>> #+TBLFM: $2=$2=vmean(@<..@>) >>> >>> >> The formula in question is the culprit in this case (at least as stated >> there). >> >> : $2=$2=vmean(@<..@>) >> >> Second column is equal to the second column which is equal to the mean of >> all the values in the second column (including the header "Sys"). >> >> If you change the table as follows: >> >> | Date | Sys | Dia | Pul | Sugar | >> |------------------+-------+-----+-----+-------| >> | [2014-04-27 Sun] | 125 | 88 | 78 | 92 | >> | [2014-04-28 Mon] | 102 | 88 | 86 | 92 | >> |------------------+-------+-----+-----+-------| >> | Averages: | 113.5 | 88 | 82 | 92 | >> #+TBLFM: @>$2..@>$>=vmean(@I..@II) >> >> All the values will properly compute. If you want to avoid the second >> HLINE above Averages: then change =@II= to =@>>= (penultimate row) >> >> Regards, >> Jon >> >> >> This is a cut down version of my full record set. Sometimes when I key >>> formulas in I get ?ERROR back for a result after keying in c-c+c-c once >>> I've completed the formula and hit tab. If I do c-u+c-c+c-c that >>> sometimes >>> generated ?ERROR. Other times I key in a formula and the cursor gets >>> locked and I have to hit c-g to exit #+TBLFM: mode; I don't know what's >>> actually happening when that situation arises since other than suddenly >>> finding the cursor locked I can neither tell what state I'm in or if a >>> few >>> more keystrokes are needed or if I've generated an error situation. >>> >>> -- >>> >>> >>> >>> >> > -- > > --001a11409ac00e444405179fb2f3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 3 June 2015 at 12:07, Jude DaShiell <jdashiel@panix.com> wrote:
This is a = piece of a modified ecm that may show what's going on.

cut here.
|----------------------+---------+--------+--------+--------|
| Averages:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 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|
| Standard Deviations: |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 = =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 | | Sums:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 108.69) | = 70.45) | 66.62) | 92.93) |
|----------------------+---------+--------+--------+--------|
#+TBLFM: @>$2..@>$>=3Dvmean(@I..@>>;%.2f)

I haven't even attempted the rest of the math since I have no way to pr= edict where any of the results will land.=C2=A0
=

@> means last line, @>> is second= to last, @>>> third to last and so on.=C2=A0 So for 7th from the = bottom it would be @>>>>>>>.

Re: Pri= ntF specification
Everything after the =3D;=3D is considered = part of the specification, so the =3D)=3D used to close the vmean is actual= ly part of the specification.=C2=A0 Changing that to =3Dvmean();%.2f=3D wil= l correct it.



For your sample ECM (plu= s original data and one sample line to actually confirm median works) you w= ould work with the following (Apologies for the very long TBLFM line):
<= br>
I was unable to find a built-in to determine the mode.=C2=A0 = I've found sample functions on Stack Overflow that would calculate it b= ased on a list, but I'm not familiar enough with Org-Table format on ho= w to go from cell references =3D@I..@II=3D to a list of values for the sake= of manipulating them.

: | Date=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |= =C2=A0=C2=A0=C2=A0 Sys |=C2=A0=C2=A0=C2=A0 Dia |=C2=A0=C2=A0=C2=A0 Pul |=C2= =A0 Sugar |
: |----------------------+--------+--------+--------+-------= -|
: | [2014-04-27 Sun]=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0 125 = |=C2=A0=C2=A0=C2=A0=C2=A0 88 |=C2=A0=C2=A0=C2=A0=C2=A0 78 |=C2=A0=C2=A0=C2= =A0=C2=A0 92 |
: | [2014-04-28 Mon]=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2= =A0=C2=A0 102 |=C2=A0=C2=A0=C2=A0=C2=A0 88 |=C2=A0=C2=A0=C2=A0=C2=A0 86 |= =C2=A0=C2=A0=C2=A0=C2=A0 92 |
: | [2014-04-29 Tue]=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0=C2=A0=C2=A0 115 |=C2=A0=C2=A0=C2=A0=C2=A0 88 |=C2=A0=C2=A0=C2= =A0=C2=A0 85 |=C2=A0=C2=A0=C2=A0=C2=A0 95 |
: |----------------------+--= ------+--------+--------+--------|
: | Averages:=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 114.00 |=C2=A0 88.00 |=C2=A0 8= 3.00 |=C2=A0 93.00 |
: | Counts:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 3.00 |=C2=A0=C2=A0 3.= 00 |=C2=A0=C2=A0 3.00 |=C2=A0=C2=A0 3.00 |
: | Maximums:=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 125.00 |=C2=A0 88.00 = |=C2=A0 86.00 |=C2=A0 95.00 |
: | Medians:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 115.00 |=C2=A0 88.00 |=C2=A0 8= 5.00 |=C2=A0 92.00 |
: | Minimums:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 102.00 |=C2=A0 88.00 |=C2=A0 78.00 |=C2=A0= 92.00 |
: | Modes:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |
: | Sta= ndard Deviations: |=C2=A0 11.53 |=C2=A0=C2=A0 0.00 |=C2=A0=C2=A0 4.36 |=C2= =A0=C2=A0 1.73 |
: | Sums:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 342.00 | 264.00 | 249.00 | = 279.00 |
: |----------------------+--------+--------+--------+--------|<= br>: #+TBLFM: @>$2..@>$>=3Dvsum(@I..@II);%.2f::@>>$2..@>&= gt;$>=3Dvsdev(@I..@II);%.2f::@>>>>$2..@>>>>$>= =3Dvmin(@I..@II);%.2f::@>>>>>$2..@>>>>>$>= =3Dvmedian(@I..@II);%.2f::@>>>>>>$2..@>>>>>= ;>$>=3Dvmax(@I..@II);%.2f::@>>>>>>>$2..@>>= >>>>>$>=3Dvcount(@I..@II);%.2f::@>>>>>>= >>$2..@>>>>>>>>$>=3Dvmean(@I..@II);%.2f
Regards,
Jonathan

On Tue, 2 Jun 2015, Jonathan Leech-Pepin wrote:

Date: Tue, 2 Jun 2015 08:04:20
From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
To: Jude DaShiell <jdashiel@panix.com>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [O] searching for csv utilities

Hello,

On 2 June 2015 at 07:44, Jude DaShiell <jdashiel@panix.com> wrote:

| Date=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Sys | Dia | Pul | Sugar |
|------------------+-------------------+-----+-----+-------|
| [2014-04-27 Sun] |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 125 |=C2=A0 88 |=C2=A0 78 |=C2=A0 =C2=A0 92 |
| [2014-04-28 Mon] |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= 102 |=C2=A0 88 |=C2=A0 86 |=C2=A0 =C2=A0 92 |
| Averages:=C2=A0 =C2=A0 =C2=A0 =C2=A0 | =3D$2=3Dvmean(@<..@>) |=C2= =A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0|
#+TBLFM: $2=3D$2=3Dvmean(@<..@>)


The formula in question is the culprit in this case (at least as stated
there).

: $2=3D$2=3Dvmean(@<..@>)

Second column is equal to the second column which is equal to the mean of all the values in the second column (including the header "Sys").=

If you change the table as follows:

| Date=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0Sys | D= ia | Pul | Sugar |
|------------------+-------+-----+-----+-------|
| [2014-04-27 Sun] |=C2=A0 =C2=A0125 |=C2=A0 88 |=C2=A0 78 |=C2=A0 =C2=A0 9= 2 |
| [2014-04-28 Mon] |=C2=A0 =C2=A0102 |=C2=A0 88 |=C2=A0 86 |=C2=A0 =C2=A0 9= 2 |
|------------------+-------+-----+-----+-------|
| Averages:=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 113.5 |=C2=A0 88 |=C2=A0 82 |=C2= =A0 =C2=A0 92 |
#+TBLFM: @>$2..@>$>=3Dvmean(@I..@II)

All the values will properly compute.=C2=A0 If you want to avoid the second=
HLINE above Averages: then change =3D@II=3D to =3D@>>=3D (penultimate= row)

Regards,
Jon


This is a cut down version of my full record set.=C2=A0 Sometimes when I ke= y
formulas in I get ?ERROR back for a result after keying in c-c+c-c once
I've completed the formula and hit tab.=C2=A0 If I do c-u+c-c+c-c that = sometimes
generated ?ERROR.=C2=A0 Other times I key in a formula and the cursor gets<= br> locked and I have to hit c-g to exit #+TBLFM: mode; I don't know what&#= 39;s
actually happening when that situation arises since other than suddenly
finding the cursor locked I can neither tell what state I'm in or if a = few
more keystrokes are needed or if I've generated an error situation.

=C2=A0--





--


--001a11409ac00e444405179fb2f3--