Note 'HPI data'
This whole post is a working script for me.
Downloads from http://www.fhfa.gov/Default.aspx?Page=87
Use .csv form if possible
If in excel - either use 'table/tara' or download, open and convert to
csv
Sometimes header data or following notes mean you need to drop
some rows from the input matrix data below.
In some cases the variable names cane be extracted from a row of the file
unpacked and used to replace entry of names as in the code below.
)
require 'csv'
data =: readcsv 'c:\users\fraser\downloads\1q11hpi_sts.csv'
NB. variables are in columns - transpose to put in rows
NB. separate character and numeric variables
state =: {. |: data
NB. character data in fields needs to be converted to numeric
'year qtr fhi' =: ". each }. |: data
NB. now have fun
load 'plot'
plot > state < /. fhi
----- Original Message -----
From: "Johann Hibschman" <[email protected]>
To: <[email protected]>
Sent: Wednesday, June 22, 2011 9:36 AM
Subject: Re: [Jprogramming] data manipulation pointers
> Johann Hibschman <[email protected]> writes:
>
>> Well, I was thinking that if I had the entire table stored as a boxed
>> array of some sort, then I could do selections on the entire table at
>> once. For example, when I was trying to extract just the subset that
>> had area-.'US', if I could do
>>
>> tableUS=. ('US'-."1 'area' tableGetRow table) tableCopy table
>
> Oops. I should have written "tableGetCol" in my pseudo-code above,
> rather than "tableGetRow". I was already thinking of a "transposed"
> representation. I hope no one wasted too much time puzzling over this.
>
> Cheers,
> Johann
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm