title: Getting no such table error using pandas and sqldf
body: <p>I am getting a sqlite3 error.</p>
  <p><code>OperationalError: no such table: Bills</code></p>
  <p>I first call my dataframes using pandas and then call those dataframes in my query which works fine</p>
  <pre><code>import pandas as pd
  from pandasql import sqldf
  
  Bills = pd.read_csv(&quot;Bills.csv&quot;)
  Accessorials = pd.read_csv(&quot;Accessorials.csv&quot;)
  
  q = &quot;&quot;&quot;
  Select          
              CityStateLane, 
              Count(BillID) as BillsCount, 
              Sum(BilledAmount) as BillsSum, 
              Count(Distinct CarrierName) as NumberOfCarriers, 
              Avg(BilledAmount) as BillsAverage, 
              Avg(BilledWeight) as WeightAverage
  From 
              Bills
  Where 
              Direction = 'THIRD PARTY' 
  Group by 
              CityStateLane
  Order by 
              BillsCount DESC
  &quot;&quot;&quot;
  
  topCityStateLane = sqldf(q)
  </code></pre>
  <p>I then create another data frame using another query but this calls the errors saying Bills is not there even though I successfully used it in the previous query.</p>
  <pre><code>q = &quot;&quot;&quot;
  SELECT
           Bills.BillID as BillID,
           A2.TotalAcc as TotalAcc
  FROM
              (SELECT
                      BillID_Value,
                      SUM(PaidAmount_Value) as &quot;TotalAcc&quot;
              FROM  
                      Accessorials 
              GROUP BY
                      BillID_Value 
              ) AS  A2,
              Bills 
  WHERE    
              A2.BillID_Value  = Bills.BillID
   &quot;&quot;&quot;
  temp = sqldf(q)
  </code></pre>
  <p>Thank you for taking the time to read this.</p>