Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about using dataframe_from_qs #2

Closed
askpatrickw opened this issue Mar 29, 2013 · 0 comments
Closed

Question about using dataframe_from_qs #2

askpatrickw opened this issue Mar 29, 2013 · 0 comments

Comments

@askpatrickw
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants