library(h5) library(zoo) if (file.exists('test.h5')) file.remove('test.h5')
[^1]: National Center for Supercomputing Applications [^2]: National Aeronautics and Space Administration
f <- h5file('test.h5') g1 <- f['group1'] g1['mat'] <- matrix(1:9, nrow = 3) g1['mat2'] <- matrix(11:19, nrow = 3) h5attr(g1, 'attr1') <- 'This is Group 1' f['group2/mat3'] <- matrix(21:29, nrow = 3) sapply(list.datasets(f), function(x) f[x][, 1]) h5close(f)
Python:
from pandas import date_range, DataFrame from numpy import random t = date_range('2010-01-01', '2016-01-01', freq='D').date randmat = random.standard_normal((len(t), 3)) df = DataFrame(randmat, index=t) df.to_hdf('ex-pandas.h5', 'testset')
R:
f <- h5file('ex-pandas.h5', 'r') dates <- as.Date(f['testset/axis1'][1:3], origin = '0001-01-01') - 1 zoo(f['testset/block0_values'][1:3, ], order.by=dates)
\center https://github.com/mannau/h5
if (file.exists('test.h5')) file.remove('test.h5')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.