<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Pandas dataframe to a table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29217#M20963</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I want to write a pandas dataframe to a table, how can I do this ? Write command is not working, please help.&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2017 06:55:01 GMT</pubDate>
    <dc:creator>KiranRastogi</dc:creator>
    <dc:date>2017-05-08T06:55:01Z</dc:date>
    <item>
      <title>Pandas dataframe to a table</title>
      <link>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29217#M20963</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I want to write a pandas dataframe to a table, how can I do this ? Write command is not working, please help.&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 06:55:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29217#M20963</guid>
      <dc:creator>KiranRastogi</dc:creator>
      <dc:date>2017-05-08T06:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pandas dataframe to a table</title>
      <link>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29218#M20964</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;could you post the code for the "write" command you are using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 06:50:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29218#M20964</guid>
      <dc:creator>PaulLintilhac</dc:creator>
      <dc:date>2017-09-25T06:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pandas dataframe to a table</title>
      <link>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29219#M20965</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hey Kiran,&lt;/P&gt;
&lt;P&gt;Just taking a stab in the dark but do you want to convert the Pandas DataFrame to a Spark DataFrame and then write out the Spark DataFrame as a non-temporary SQL table?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;import pandas as pd
## Create Pandas Frame
pd_df = pd.DataFrame({u'2017-01-01': 1, u'2017-01-02': 2}.items())
## Convert into Spark DataFrame
spark_df = spark.createDataFrame(pd_df)
## Write Frame out as Table
spark_df.write.mode("overwrite").saveAsTable("db.table_name")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The Python documentation for &lt;PRE&gt;&lt;CODE&gt;saveAsTable&lt;/CODE&gt;&lt;/PRE&gt; is also available here: Python API Documentation.&lt;/P&gt;
&lt;P&gt;Amy&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 18:13:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pandas-dataframe-to-a-table/m-p/29219#M20965</guid>
      <dc:creator>amy_wang</dc:creator>
      <dc:date>2017-09-27T18:13:12Z</dc:date>
    </item>
  </channel>
</rss>

