title: How to Import column from xlsx > Create Json Array > Update SQLite DB
body: <p>I need help converting the xlsx or a csv file into something that looks like the example below so that I could import it into SQLite.</p>
  <pre><code>Stocks_Update = [
      {'stock_ticker' : 'TSLA'},
      {'stock_ticker' : 'MSFT'},
      {'stock_ticker' : 'AAPL'},
      {'stock_ticker' : 'GOOG'},
      {'stock_ticker' : 'FB'},
      {'stock_ticker' : 'SQ'},
      
  ]
  </code></pre>
  <p>The columns looks like this in excel</p>
  <p><a href="https://i.stack.imgur.com/qUfoa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qUfoa.png" alt="enter image description here" /></a></p>
  <p>I have found a way to import it using</p>
  <pre><code>import pandas as pd
  from pandas import ExcelWriter
  from tkinter import Tk
  from tkinter.filedialog import askopenfilename
  
  root = Tk()
  ftypes = [(&quot;.xlsm&quot;,&quot;*.xlsx&quot;,&quot;.xls&quot;)]
  ttl  = &quot;Title&quot;
  dir1 = 'C:\\'
  filePath=r&quot;C:\Users\home\Desktop\code_projects\FIRE_Dashboard\stock_ticker.xlsx&quot;
  #filePath = askopenfilename(filetypes = ftypes, initialdir = dir1, title = ttl)
  </code></pre>
  <p>The tutorial where I found this makes the imported file into a pandas dataframe. But I need to make that array instead.</p>
  <pre><code>stocklist = pd.read_excel(filePath)
  stocklist=stocklist.head()
  
  exportList= pd.DataFrame(columns=['Stock', &quot;RS_Rating&quot;, &quot;50 Day MA&quot;, &quot;150 Day Ma&quot;, &quot;200 Day MA&quot;, &quot;52 Week Low&quot;, &quot;52 week High&quot;])
  </code></pre>
  <p>So that I could import it into SQLite using</p>
  <pre><code>def update_Stocks():
      for data_point in Stocks_Update:
  
          try:
              Stocks.create(stock_ticker=data_point['stock_ticker'])
          except IntegrityError:
              update_record = Stocks.get(stock_ticker=data_point['stock_ticker'])
              update_record.stock_ticker = data_point['stock_ticker']
              update_record.save()
  </code></pre>
  <p>I am completely lost on where to even get started, as I am not even sure if the thing I need as a final result is a json array or not but it looks similar. Any help on how to do this is much appreciated along with helping a noobie with the correct terminology. Maybe if I knew what it was called I would be able to find a guide for it online.</p>
  <p>Anyway thanks again :)</p>