TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bhavesh R
NA
15
3.7k
Return my df from panddf and pass it as argument to graphview function
May 25 2021 4:02 PM
I want my dataframe to be passed into the graphview function..Am trying to get values from df and pass to the graphview function..Can anyone help me with this??
from django.http import JsonResponse
from django.shortcuts import render
from board.models import userboard
from.utils import get_plot
import pandas as pd
from sqlalchemy import create_engine
def graphview(request):
qs =userboard.obects.all()
x=[x.Month for x in qs]
y=[y.Bp_Values for y in qs]
chart = get_plot(x,y)
return render(request, 'piechart.html' ,{'chart':chart})
def panddf(request):
username = None
if request.user.is_authenticated:
username = request.user.username
print(username) engine=create_engine('postgresql+psycopg2://postgres:#24May@2002@localhost/bhavesh')
df = pd.read_sql_query('SELECT * FROM public."board_userboard"',con=engine)
filt = (df['User_name'] == username)
print(df[filt])
df1 = (df[filt])
return render(request, 'abc.html')
Reply
Answers (
0
)
Error running C:\Users\Administrator\AppData\Local\Temp\postgresql_ins
LSTM Layer accuracy is 0