I have one function in R. I want to use that function in python.But I am getting error while passing arguments.
Calling R function from python referenced from calling a R function from python code with passing arguments this site.
I have tried like below with my exisiting function
path=""
actual_values= data['col1']
predicted_values = data['col2']
def function1(input1,output):
r=ro.r
r.source(path+"script.R")
p=r.metrics_fun(input1,output) # function name in the R is metrics_fun
return p
output_df = function1(actual_values,predicted_values)
I am getting error like below
NotImplementedError: Conversion 'py2rpy' not defined for objects of type '<class 'pandas.core.series.Series'>'
Please, help me to find solution for this.