[Jprogramming] Unboxing - a strange result I don;t understand
bill lam
bbill.lam at gmail.com
Thu Sep 22 10:12:50 HKT 2011
I guess this is unrelated to unboa but print precision, please try set a
larger quot pp or use dyad ": to specify precision, eg
+/2345.22 3456.33 6543.33 6543.44 5445.44
24333.8
0j15":+/2345.22 3456.33 6543.33 6543.44 5445.44
24333.760000000002037
Срд, 21 Сен 2011, Linda Alvord писал(а):
>
> b=:'2345.22';'3456.33';'6543.33';'6543.44';'5445.44'
> b
> ┌───────┬───────┬───────┬───────┬───────┐
> │2345.22│3456.33│6543.33│6543.44│5445.44│
> └───────┴───────┴───────┴───────┴───────┘ NB. I don’t know how to make this look better.
> >b
> 2345.22
> 3456.33
> 6543.33
> 6543.44
> 5445.44
>
> ".&>b
> 2345.22 3456.33 6543.33 6543.44 5445.44
>
> These are now numbers, but the sum isn't correct.
>
> +/".&>b
> 24333.8
>
>
> Another way to get the list of numbers has the wrong sum
>
> ,(>b),"1 ' '
> 2345.22 3456.33 6543.33 6543.44 5445.44
>
> ".,(>b),"1 ' '
> 2345.22 3456.33 6543.33 6543.44 5445.44
> +/".,(>b),"1 ' '
> 24333.8
>
> What am I missing?
>
> Linda
>
>
> -----Original Message-----
> From: programming-bounces at jsoftware.com [mailto:programming-bounces at jsoftware.com] On Behalf Of Ric Sherlock
> Sent: Tuesday, August 23, 2011 7:35 PM
> To: Programming forum
> Subject: Re: [Jprogramming] Unboxing
>
> If you are working with larger arrays then you will find the following
> faster and leaner:
>
> _".>boxed
> 5928.6 5990 5938.9 5881 5870.1 5858.4
>
> bigboxed=: 1e6 $ boxed
> timespacex '0". > bigboxed'
> 0.161143 4.29933e7
>
> timespacex '_ ".&> bigboxed'
> 0.714034 2.06763e8
>
>
> On Wed, Aug 24, 2011 at 11:16 AM, james wafula <jbukossia at yahoo.com> wrote:
> > Hi,
> > I read the data from a csv file and selected the column I was interested in via dyadic { . Dan's technique has worked.
> > Regards.
> >
> >
> > ________________________________
> > From: Tracy Harms <kaleidic at gmail.com>
> > To: Programming forum <programming at jsoftware.com>
> > Sent: Wednesday, August 24, 2011 1:50 AM
> > Subject: Re: [Jprogramming] Unboxing
> >
> > However, if you originally were working with numbers, converted those
> > numbers to text in the midst of boxing, yet actually has no need for a
> > textual representation, Dan's technique would not be as nice as removing the
> > unnecesary conversion to text.
> >
> > We do not have enough context to know whether that is the case.
> >
> > --T
> > On Aug 23, 2011 9:26 AM, "Raul Miller" <rauldmiller at gmail.com> wrote:
> >> On Tue, Aug 23, 2011 at 9:07 AM, james wafula <jbukossia at yahoo.com> wrote:
> >>> I am trying to make a list after unboxing but I am experiencing
> > challenges. Is there something I am not getting right?
> >>>
> >>> boxed
> >>> ┌───────┬───────┬───────┬───────┬───────┬───────┐
> >>> │5928.60│5990.00│5938.90│5881.00│5870.10│5858.40│
> >>> └───────┴───────┴───────┴───────┴───────┴───────┘
> >>> >boxed
> >>> 5928.60
> >>> 5990.00
> >>> 5938.90
> >>> 5881.00
> >>> 5870.10
> >>> 5858.40
> >>> ,>boxed
> >>> 5928.605990.005938.905881.005870.105858.40
> >>>
> >>> I need to obtain:
> >>> 5928.60 5990.00 5938.90 5881.00 5870.10 5858.40
> >>
> >> This is not just unboxing. You need to know what you have in those boxes.
> >>
> >> $&.> will tell you the shape of the contents, for example.
> >>
> >> From the looks of things, however, your boxes contain sequences of
> >> characters and you want numbers. Thus, Dan Bron's suggestion is
> >> probably the right answer:
> >>
> >> The content of each box should be turned into a number.
> >>
> >> --
> >> Raul
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
More information about the Programming
mailing list