<?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 Re: Remove duplicate records using pyspark in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/remove-duplicate-records-using-pyspark/m-p/85932#M8197</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/25618"&gt;@sanjay&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can write window function that will rank your rows and then filter rows based on that rank.&lt;/P&gt;&lt;P&gt;Take a look on below stackoverflow thread:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/63343958/how-to-drop-duplicates-but-keep-first-in-pyspark-dataframe" target="_blank"&gt;https://stackoverflow.com/questions/63343958/how-to-drop-duplicates-but-keep-first-in-pyspark-dataframe&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 18:36:19 GMT</pubDate>
    <dc:creator>szymon_dybczak</dc:creator>
    <dc:date>2024-08-28T18:36:19Z</dc:date>
    <item>
      <title>Remove duplicate records using pyspark</title>
      <link>https://community.databricks.com/t5/get-started-discussions/remove-duplicate-records-using-pyspark/m-p/85883#M8196</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to remove duplicate records from pyspark dataframe and keep the latest one. But somehow df.dropDuplicates["id"] keeps the first one instead of latest. One of the option is to use pandas drop_duplicates, Is there any solution in pyspark.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sanjay&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 17:15:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/remove-duplicate-records-using-pyspark/m-p/85883#M8196</guid>
      <dc:creator>sanjay</dc:creator>
      <dc:date>2024-08-28T17:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate records using pyspark</title>
      <link>https://community.databricks.com/t5/get-started-discussions/remove-duplicate-records-using-pyspark/m-p/85932#M8197</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/25618"&gt;@sanjay&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can write window function that will rank your rows and then filter rows based on that rank.&lt;/P&gt;&lt;P&gt;Take a look on below stackoverflow thread:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/63343958/how-to-drop-duplicates-but-keep-first-in-pyspark-dataframe" target="_blank"&gt;https://stackoverflow.com/questions/63343958/how-to-drop-duplicates-but-keep-first-in-pyspark-dataframe&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 18:36:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/remove-duplicate-records-using-pyspark/m-p/85932#M8197</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-08-28T18:36:19Z</dc:date>
    </item>
  </channel>
</rss>

