Re: how to find the nearest holiday

2017-04-25 Thread Zeming Yu
-+ >>> |2017-08-11|[2017-05-30,2017-10-01]| >>> >>> >>> calculate a column called "days_from_nearest_holiday" which calculates the >>> difference between 11 aug 2017 and 1 oct 2017? >>> >>> >>> >&g

Re: how to find the nearest holiday

2017-04-25 Thread Pushkar.Gujar
t;> >> >> >> On Tue, Apr 25, 2017 at 6:00 PM, Wen Pei Yu wrote: >> >>> TypeError: unorderable types: str() >= datetime.date() >>> >>> Should transfer string to Date type when compare. >>> >>> Yu Wenpei. >>&g

Re: how to find the nearest holiday

2017-04-25 Thread Zeming Yu
> >> TypeError: unorderable types: str() >= datetime.date() >> >> Should transfer string to Date type when compare. >> >> Yu Wenpei. >> >> >> - Original message - >> From: Zeming Yu >> To: user >> Cc: >> Subject:

Re: how to find the nearest holiday

2017-04-25 Thread Zeming Yu
er string to Date type when compare. > > Yu Wenpei. > > > - Original message - > From: Zeming Yu > To: user > Cc: > Subject: how to find the nearest holiday > Date: Tue, Apr 25, 2017 3:39 PM > > I have a column of dates (date type), just trying to find t

Re: how to find the nearest holiday

2017-04-25 Thread Wen Pei Yu
TypeError: unorderable types: str() >= datetime.date()   Should transfer string to Date type when compare.   Yu Wenpei.   - Original message -From: Zeming Yu To: user Cc:Subject: how to find the nearest holidayDate: Tue, Apr 25, 2017 3:39 PM  I have a column of dates (date type), just tryin

how to find the nearest holiday

2017-04-25 Thread Zeming Yu
I have a column of dates (date type), just trying to find the nearest holiday of the date. Anyone has any idea what went wrong below? start_date_test = flight3.select("start_date").distinct() start_date_test.show() holidays = ['2017-09-01', '2017-10-01'] +--+ |start_date| +--+