piper.custom.to_julian¶
-
piper.custom.to_julian(greg_date: Union[str, int], format: Optional[str] = None)[source]¶ apply_date function: Gregorian -> (JDE) Julian
- Parameters
greg_date (gregorian format date (string)) –
- Returns
- Return type
JDE Julian formatted string
References
# https://docs.oracle.com/cd/E26228_01/doc.93/e21961/julian_date_conv.htm#WEAWX259 # http://nimishprabhu.com/the-mystery-of-jde-julian-date-format-solved.html
Examples
%%piper sample_sales() >> select(['-target_profit', '-actual_profit']) # >> assign(month = lambda x: x['month'].apply(to_julian)) >> across('month', to_julian) >> assign(month = lambda x: x['month'].apply(from_julian)) # >> across('month', from_julian) >> head(5) location product month target_sales actual_sales London Beachwear 2021-01-01 31749 29209.1 London Beachwear 2021-01-01 37833 34049.7 London Jeans 2021-01-01 29485 31549 London Jeans 2021-01-01 37524 40901.2 London Sportswear 2021-01-01 27216 29121.1