title: Flask and Pandas
body: <p>I am trying to show a pandas dataframe in flask and I am using the to_html() function to do so. However, it seems that the to_html() overwrites my html template. Flask shows the dataframe but not within the home.html template. I can't quite figure out how to get the dataframe to appear in the home.html template. How can I format the dataframe within the home.html template?</p>
  
  <pre><code>@app.route('/')
  def index():
  
  df_holdings=pd.read_csv('Holdings.csv')
  df_holdings=df_holdings[['Sector','Security','Position','% Wgt','Market 
  Value','Closing Price']]
  return df_holdings.to_html()
  return render_template('home.html')
  </code></pre>