Public
Edited
May 1, 2023
2 forks
1 star
Insert cell
Insert cell
hmm = {
const f = new arrow.FixedSizeList(
5,
new arrow.Field("inner", new arrow.Float16())
);

const data = [
new Float32Array([1.1, 2.2, 3.3, 4.4, 5.5]),
new Float32Array([6.6, 7.7, 8.8, 9.9, 10.1])
];

const arrays = data.map((float32Array) => {
return arrow.makeVector(data);
});

let builder = arrow.makeBuilder({
type: f,
children: [{ type: new arrow.Float16() }]
});

for (let datum of data) {
builder = builder.append(datum);
}

const v = builder.finish().toVector();
return v;
}
Insert cell
hmm.get(0).toArray()
Insert cell
hmm.toArray()[0].toArray()
Insert cell
arrow = require("apache-arrow@11.0.0")
Insert cell
g = new arrow.vectorFromArray([1.1, 2.2, 3.3], new arrow.Float16()).toArray()
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more