This works fine (and is awesome):
import nimpy
let pd = pyImport("pandas")
let datasets = pyImport("sklearn.datasets")
var data = datasets.load_iris(as_frame=true, return_X_y=true)
echo data[0]
var test = data[0]
echo test.iloc[[0]]
But wondering how do you do something like this:
echo test.iloc[1:3, 0:3]
Try
echo test.iloc[1..<3, 0..<3]
Nimpy doesn't support this notation yet, but something like this should work:
let py = pyBuiltinsModule()
echo test.iloc[(py.slice(1, 2), py.slice(0, 2))]
The py.slice would be generated by torchSlice here: https://github.com/SciNim/flambeau/blob/ada225095/flambeau/raw/sugar/indexing.nim#L188-L375