I have the following summary for dataset, using pyspark on databricks
OrderMonthYear | SaleAmount |
---|---|
2012-11-01T00:00:00.000+0000 | 473760.5700000001 |
2010-04-01T00:00:00.000+0000 | 490967.0900000001 |
I'm having dataframe error for this map function to convert OrderMonthYear into integer type
results = summary.map(lambda r: (int(r.OrderMonthYear.replace('-','')), r.SaleAmount)).toDF(["OrderMonthYear","SaleAmount"])
any ideas?
AttributeError: 'DataFrame' object has no attribute 'map'