I have a table "b" (example below) which is the transpose of table "a"
which is read in from a file. Here's what table b looks like, just so
you have an idea of what's where:
+--------+-----------+--------+--------+-----------+...
|F |CAT |DE |CSX |XOM |...
+--------+-----------+--------+--------+-----------+...
|Ford |Caterpillar|Deere |CSX |Exxon Mobil|...
+--------+-----------+--------+--------+-----------+...
|3710 |665 |410 |890 |4000 |...
+--------+-----------+--------+--------+-----------+...
|19560307|19291202 |19330609|19801103|19991201 |...
+--------+-----------+--------+--------+-----------+...
|0 |0 |0 |0 |0 |...
+--------+-----------+--------+--------+-----------+...
|0 |0 |0 |0 |0 |...
+--------+-----------+--------+--------+-----------+...
The problem I'm having is with amending individual cells in both row 4
and row 5 (the last two rows) of table b. (I've run into this problem
before, but I created lengthy workarounds which are not really J-ish.
I decided this time to ask the wisdom of the J community to finally
find out once and for all what the "right" way of doing this kind of
thing is.)
I don't run into problems READING an individual cell, such as:
stocksym=. toupper > (j { 0 { b)
However, when I attempt to WRITE an amend into the jth (e.g., first)
cell of row 4 of table b, for example:
b=. (< stocknum) j } (4 { b)
table b is incorrectly changed (compared to my intent, that is) from
the table shown above to a list instead:
+-+-+-+-+-+...
|6|0|0|0|0|...
+-+-+-+-+-+...
Is there some "standard" way of making such amends within a table that
I seem to be missing somewhere along the line? Thanks for your help!
Harvey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm