Created
December 27, 2021 12:35
-
-
Save 1ambda/e516cb5ee85be4ddab1b33e7fbb9c7db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dateStart = "2019-12-01" | |
dateEnd = "2019-12-31" | |
dfCalendarSalesFiltered = dfListingCalendar\ | |
.where(col("available") == lit('f'))\ | |
.withColumn("date", col("date").cast(DateType()))\ | |
.where(col("date").between(lit(dateStart).cast(DateType()), lit(dateEnd).cast(DateType()))) | |
dfCalendarSalesDec = dfCalendarSalesFiltered\ | |
.groupBy("date")\ | |
.agg(countDistinct("listing_id")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment