Published
Edited
Dec 15, 2020
Insert cell
md`# Apache Arrow Timestamp Investigation`
Insert cell
arrow = require('apache-arrow')
Insert cell
md`### loading a feather file with a datetime64[ns] col, written with pandas/pyarrow 2`
Insert cell
Insert cell
Insert cell
df = fetchArrow(url)
Insert cell
tsSeries = df.getColumn('event_timestamp')
Insert cell
md`### No timestamps here ...`
Insert cell
tsSeries.get(50)
Insert cell
tsSeries.toArray()
Insert cell
{
const timestamps = [];
for (const ts of tsSeries) {
timestamps.push(ts);
}
return timestamps;
}
Insert cell
// Fetch and instantiate an Arrow-formatted dataset
async function fetchArrow(dataUrl) {
// return arrow.Table.from(fetch(dataUrl));
const buf = await fetch(dataUrl).then(response => response.arrayBuffer());
return arrow.Table.from(new Uint8Array(buf));
}
Insert cell
md`### And an Arquero test for good measure`
Insert cell
import { aq, op } from '@uwdata/arquero'
Insert cell
aq.fromArrow(df).view()
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