I am trying to run a Python function fitKCA
within the R environment through the package reticulate
.
The function is sourced correctly and all I do is to call the function:
fitKCA(z = bh$V1, q = 0.1)
and pass the two arguments:
bh$V1
, a column (of typedbl
) of a tibbleq
, a scalar
Nevertheless, I get the following error message:
Error in py_call_impl(callable, dots$args, dots$keywords):AttributeError: 'list' object has no attribute 'shape'
In my understanding, the column of the tibble extracted through the $
sign is of the R type list
and this clashes with the Python numpy
library and hence has no shape
attribute.
So my questions are:
how can I avoid this error?
How do R objects match Python objects (i.e. if I use the
$
sign is it compatible withnumpy
orpandas
? Or what if I use insteadbh[,2]
orbh[,"V1"]
, is there any difference?)?
Many thanks and forgive my evident lack of computer science background.