This example shows how to create a Pandas dataframe from voxels inside a Report Lambda program and output a different dataframe as a result.


import pandas

import voxelfarm as vf


entity = vf.input_entity("entity""Select Entity"vf.type.block_model)

voxels = vf.load_voxels(entityvf.attribute.volume'fe, density')


df_model = vf.load_pandas_dataframe(voxels)

df_model['tonnes'] = df_model['fe'] * df_model['volume'] * df_model['density']

df_model = df_model['volume''tonnes']

df_output = df_model.sum(axis=0)

vf.sum_pandas_result('report'df_output)