[Thread Prev][Thread Next][Index]

[ferret_users] Re: [ferret_users] records

Hi all, there is py_ferret. You may start it as python and call ferret methods
from python. Alternatively you may start ferret and call python modules.

May be this helps to solve the problem?

Am 2015-11-12 15:49, schrieb Ryo Furue:
Hi Marco,

    let A.x = "some name"
    let A.y = 10
    let A.z = 3.14

Ultimately I'd like to define an array consisting of records:

    let B.x = {"first name", "second name", "third name"}
    let B.y = {1, 2, 3}
    let B.z = {0.1, 0.2, 0.3}

or the other way around starting with records and putting them in an

    let C = { A, A2, ... }

This is far from ideal, but you can simulate a record with an array
and therefore an array of records with a two dimensional array:

let C0 = {"first", "second", "third", "1", "2", "3", "0.1", "0.2", "0.3"}
. . . .
let C = reshape(C0, . . . )  ! convert to 2D array
list C[j=1]
. . .

It seems that Ferret doesn't allow mixed types in single arrays, but
you can represent any numerical values with character strings as above
and "convert" them to numbers using the backquote evaluation:

let a = "0.1"
let b = `a` + 0.2
say `b`

Having said that, I think it would be more fruitful and rewarding to
use a scripting language like Ruby and Python to write such a program
as this, calling Ferret from within it, than to fight with Ferret.



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement