title: Returning an error while converting pandas dataframe to PySpark dafarame
body: <p>I'm trying to convert pandas dataframe to PySpark dataframe. Below is the code</p>
  <pre><code>df_spark = spark.createDataFrame(df)
  </code></pre>
  <p>Below is the output error</p>
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-27-702c2cd1f44b&gt; in &lt;module&gt;
  ----&gt; 1 df_spark = spark.createDataFrame(df)
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/session.py in createDataFrame(self, data, schema, samplingRatio, verifySchema)
      672             # Create a DataFrame from pandas DataFrame.
      673             return super(SparkSession, self).createDataFrame(
  --&gt; 674                 data, schema, samplingRatio, verifySchema)
      675         return self._create_dataframe(data, schema, samplingRatio, verifySchema)
      676 
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/pandas/conversion.py in createDataFrame(self, data, schema, samplingRatio, verifySchema)
      338                     raise
      339         data = self._convert_from_pandas(data, schema, timezone)
  --&gt; 340         return self._create_dataframe(data, schema, samplingRatio, verifySchema)
      341 
      342     def _convert_from_pandas(self, pdf, schema, timezone):
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/session.py in _create_dataframe(self, data, schema, samplingRatio, verifySchema)
      698             rdd, schema = self._createFromRDD(data.map(prepare), schema, samplingRatio)
      699         else:
  --&gt; 700             rdd, schema = self._createFromLocal(map(prepare, data), schema)
      701         jrdd = self._jvm.SerDeUtil.toJavaArray(rdd._to_java_object_rdd())
      702         jdf = self._jsparkSession.applySchemaToPythonRDD(jrdd.rdd(), schema.json())
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/session.py in _createFromLocal(self, data, schema)
      523 
      524         # convert python objects to sql data
  --&gt; 525         data = [schema.toInternal(row) for row in data]
      526         return self._sc.parallelize(data), schema
      527 
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/session.py in &lt;listcomp&gt;(.0)
      523 
      524         # convert python objects to sql data
  --&gt; 525         data = [schema.toInternal(row) for row in data]
      526         return self._sc.parallelize(data), schema
      527 
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/types.py in toInternal(self, obj)
      625             elif isinstance(obj, (tuple, list)):
      626                 return tuple(f.toInternal(v) if c else v
  --&gt; 627                              for f, v, c in zip(self.fields, obj, self._needConversion))
      628             elif hasattr(obj, &quot;__dict__&quot;):
      629                 d = obj.__dict__
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/types.py in &lt;genexpr&gt;(.0)
      625             elif isinstance(obj, (tuple, list)):
      626                 return tuple(f.toInternal(v) if c else v
  --&gt; 627                              for f, v, c in zip(self.fields, obj, self._needConversion))
      628             elif hasattr(obj, &quot;__dict__&quot;):
      629                 d = obj.__dict__
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/types.py in toInternal(self, obj)
      449 
      450     def toInternal(self, obj):
  --&gt; 451         return self.dataType.toInternal(obj)
      452 
      453     def fromInternal(self, obj):
  
  /jupyter/conda/envs/default/lib/python3.7/site-packages/pyspark/sql/types.py in toInternal(self, dt)
      180         if dt is not None:
      181             seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
  --&gt; 182                        else time.mktime(dt.timetuple()))
      183             return int(seconds) * 1000000 + dt.microsecond
      184 
  
  AttributeError: 'datetime.time' object has no attribute 'timetuple'
  </code></pre>
  <p>I'm new to PySpark. I'm unable to understand what's happening exactly. Can anyone please help me with this issue?</p>