title: ValueError: cannot infer type for <class 'NoneType'> - Flask, sqlite
body: <p>I'm trying to upload a dataframe to sqlite database which has no problem unless I add the 'quarters' column. </p>
  
  <pre><code>df['quarters'] = pd.PeriodIndex(pd.df(empres_df.date), freq='Q')
  df.to_sql("table_name", con, if_exists="append")
  </code></pre>
  
  <p>Because when I do, it gives me this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/opt/anaconda3/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
      response = self.full_dispatch_request()
    File "/opt/anaconda3/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/opt/anaconda3/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "/opt/anaconda3/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
      raise value
    File "/opt/anaconda3/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
      rv = self.dispatch_request()
    File "/opt/anaconda3/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/Users/mkhumtai/Desktop/IndividualProject/avian/app/views.py", line 145, in import_data
      empres_df.to_sql("empres", con, if_exists="append")
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 2712, in to_sql
      method=method,
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 518, in to_sql
      method=method,
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 1747, in to_sql
      dtype=dtype,
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 1440, in __init__
      super().__init__(*args, **kwargs)
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 619, in __init__
      self.table = self._create_table_setup()
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 1476, in _create_table_setup
      column_names_and_types = self._get_column_names_and_types(self._sql_type_name)
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 860, in _get_column_names_and_types
      for i in range(len(self.frame.columns))
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 860, in &lt;listcomp&gt;
      for i in range(len(self.frame.columns))
    File "/opt/anaconda3/lib/python3.7/site-packages/pandas/io/sql.py", line 1532, in _sql_type_name
      col_type = lib.infer_dtype(col, skipna=True)
    File "pandas/_libs/lib.pyx", line 1246, in pandas._libs.lib.infer_dtype
  ValueError: cannot infer type for &lt;class 'NoneType'&gt;
  </code></pre>
  
  <p>Adding the 'quarters' column to the dataframe itself doesn't give an error as long as I don't include that column to the database. </p>
  
  <p>How do I fix this?</p>