You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, i'm not a real dev, just trying to hack together a prototype of something. I want to use pandas to transpose a table from my database and the first step is to convert the queryset to a dataform and I stumbled upon dataframe_from_qs and was hoping it would help me out.
I put the function in my views.py and and then called it as so:
When I run it I get an error that a list object has no next referring to this line in dataframe_from_qs() :
df = DataFrame.from_records(rows.next(), columns=columns, coerce_float=True)
Is there something simple I'm missing here? I should add, I know that HttpResponse is kind of pointless. I'm just using it to see what I get. I'm planning to them pass everything to a proper template.
Thanks,
-patrick
The text was updated successfully, but these errors were encountered:
Hey there, i'm not a real dev, just trying to hack together a prototype of something. I want to use pandas to transpose a table from my database and the first step is to convert the queryset to a dataform and I stumbled upon dataframe_from_qs and was hoping it would help me out.
I put the function in my views.py and and then called it as so:
def index(request):
def index(request):
qs = Tablet.objects.all()
df = dataframe_from_qs(qs)
df.transpose()
return HttpResponse(df)
When I run it I get an error that a list object has no next referring to this line in dataframe_from_qs() :
df = DataFrame.from_records(rows.next(), columns=columns, coerce_float=True)
Is there something simple I'm missing here? I should add, I know that HttpResponse is kind of pointless. I'm just using it to see what I get. I'm planning to them pass everything to a proper template.
Thanks,
-patrick
The text was updated successfully, but these errors were encountered: