Py.Cafe

maartenbreddels/

arro3-test

Array Operations Demo with Solara and Arro3

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

import solara
from arro3.core import Array, DataType, Table
from arro3.compute import take

arr = Array([1, 2, 3], DataType.int16())
indices = Array([0, 2], DataType.int16())
clicks = solara.reactive(0)


@solara.component
def Page():
    solara.Text(repr(arr.to_numpy()))
    solara.Text(repr(arr.to_numpy().sum()))
    some = take(arr, indices)
    solara.Text(repr(some.to_numpy()))
    solara.Text(repr(some.to_numpy().sum()))