I tend to use delimited text files like this:
'hdr dat'=. split readcsv '/home/dan/Downloads/Master.csv'
(<'Joe') +/ . =dat{"1 hdr i. <'nameFirst' NB. How many "Joe"s?
where "split" is ({. ,&< }.).That is, split and assign the header and the
data in one statement and don't bother assigning "index" because it's more
self-documenting to generate it from the header as you use it.
On Mon, Oct 7, 2013 at 5:41 PM, Dan Farmer <[email protected]> wrote:
> I hope you guys won't mind me extending this question, but just
> playing around with that data I got to thinking. Ok, I know there are
> 398 Joe's in here.
>
> What is the distribution of names like? Taking off from Ganesh's example
>
> NB. How many total?
>
> #(index {"1 data )
>
> 18125
>
> NB. How many unique names?
>
> #~. (index {"1 data )
>
> 2209
>
> Ok, now if I wanted to get counts for each name, I want to connect the
> names from ~. (index {"1 data ) to the counting phrase Ganesh
> provided:
>
> +/@:= index {"1 data -- but not sure how...?
>
> -Dan
>
> On Mon, Oct 7, 2013 at 2:04 PM, Dan Bron <[email protected]> wrote:
> > Ganesh Rapolu
> >> Because the data is boxed, all comparisons must be boxed.
> >
> > This was very well put (one short sentence which both clarifies the
> problem
> > and justifies the solution).
> >
> > -Dan
> >
> >
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Devon McCormick, CFA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm