Django - App crashing when using pandas2ri

半腔热情 提交于 2019-12-22 12:33:53

问题


I am implementing rpy2 code in Django and when I convert pandas dataframe into r dataframe my app starts crashing and giving error:

Error: C stack usage  60820464 is too close to the limit

otherwise app works fine as long as i don't convert. Is there any problem/mistake in my code?

My code snippet:

from .models import Values
import pandas as pd
from rpy2.robjects import pandas2ri
pandas2ri.activate()

def rpyset(request):
filterdata = pd.DataFrame(list(Values.objects.all().values('val1','val2', 'val3', 'val4', 'val5', 'val6')))
r_dataframe = pandas2ri.py2ri(filterdata)
# I want to pass r_dataframe to an rpy2 function but unable to proceed because of error
return HttpResponse(filterdataahp.to_html())

来源:https://stackoverflow.com/questions/51798111/django-app-crashing-when-using-pandas2ri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!