title: Get X Y value from Panda Dataframe
body: <p>I'm trying to make this dataframe spit out the &quot;x&quot; value and &quot;y&quot; value and I'm completely stuck. I'm not sure how to go about this and the end goal is to make it plot the X and Y values on a graph, I'm just not sure how I would go about extracting these values. When I do iloc to try and get this information I get the indexes and while this isn't necessarily a problem it just added to my overall confusion. Here's one of my files and either a solution or explanation on how to do it would be extremely appreciated, I keep confusing myself more and more. Thanks so much</p>
  <p>EDIT: I got better clarification and realize in this example month would be the x and average would be the y. So I know I can do data.iloc to get these values one by one, but is there a way I could add this to like a for loop for example to iterate through all the values one by one and then have them all get plotted on a graph? I cant think of the best way to accomplish this</p>
  <pre><code>from flask import render_template, request, redirect
  from app import app
  import os
  import csv
  import pandas as pd
  
  @app.route('/', methods=[&quot;GET&quot;, &quot;POST&quot;])
  def index():
      data = []
      if request.method == 'POST':
          if request.files:
              uploaded_file = request.files['filename']
              filepath = os.path.join(app.config['FILE_UPLOADS'], uploaded_file.filename)
              uploaded_file.save(filepath)
              with open(filepath) as file:
                  csv_file = csv.reader(file)
                  for row in csv_file:
                      data.append(row)
              data = pd.DataFrame(data)
              print(data)
              return render_template('index.html', tables=[data.to_html(classes='data')], titles=data.columns.values, header=False, index=False)
      return render_template('index.html', data=data)
  
  
  @app.route('/help')
  def help():
      return render_template('help.html')
  
  app.config['FILE_UPLOADS'] = &quot;C:\\Users\\Zachary\\Documents\\VSCode_Projects\\monday_webapp\\app\\static\\file\\uploads&quot;
  </code></pre>
  <p>This is a sample CSV I'm using</p>
  <pre><code>&quot;Month&quot;, &quot;Average&quot;
  &quot;May&quot;,  0.1
  &quot;Jun&quot;,  0.5
  &quot;Jul&quot;,  0.7
  &quot;Aug&quot;,  2.3
  &quot;Sep&quot;,  3.5
  &quot;Oct&quot;,  2.0
  &quot;Nov&quot;,  0.5
  &quot;Dec&quot;,  0.0
  
  </code></pre>