Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyspark groupby with condition

df.filter(df.reg_date >= df.txn_date) 
  .groupBy(df.reg_date) 
  .agg(F.min(df.txn_date)) 
  .show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pyspark #groupby #condition
ADD COMMENT
Topic
Name
1+2 =