Beispiel #1
0
def to_weekdayname(date, abr = False):
	try:
		result = to_datetime(date).dt.weekday_name
		if abr:
			return result.str[:3]
		else:
			return result
	except:
		return lp_to_date_part(date=date, date_part='weekday_name', abr=abr)
Beispiel #2
0
def to_day(date):
	try:
		return to_datetime(date).dt.day
	except:
		return lp_to_date_part(date=date, date_part='day')
Beispiel #3
0
def to_year_monthname(date, sep='-', abr=False):
	try:
		return date.map(lambda x: lp_to_date_part(date=x, date_part='year_monthname', sep=sep, abr=abr))
	except:
		return lp_to_date_part(date=date, date_part='year_monthname', sep=sep, abr=abr)
Beispiel #4
0
def to_weekday(date):
	try:
		return date.map(lambda x: lp_to_date_part(date=x, date_part='weekday'))
	except:
		return lp_to_date_part(date=date, date_part='weekday')
Beispiel #5
0
def to_monthname(date, abr = False):
	try:
		return date.map(lambda x: lp_to_date_part(date=x, date_part='month_name', abr=abr))
	except:
		return lp_to_date_part(date=date, date_part='month_name', abr=abr)
Beispiel #6
0
def to_yearquarter(date, sep ='-'):
	try:
		return date.map(lambda x: lp_to_date_part(date=x, date_part='year_quarter', sep=sep))
	except:
		return lp_to_date_part(date=date, date_part='yearquarter')
Beispiel #7
0
def to_yearmonth(date, sep ='-'):
	try:
		return date.map(lambda x: lp_to_date_part(date=x, date_part='year_month', sep=sep))
	except:
		return lp_to_date_part(date=date, date_part='yearmonth', sep = sep)
Beispiel #8
0
def to_year(date):
	try:
		return to_datetime(date).dt.year
	except:
		return lp_to_date_part(date=date, date_part='year')
Beispiel #9
0
def to_quarter(date):
	try:
		return to_datetime(date).dt.quarter
	except:
		return lp_to_date_part(date=date, date_part='quarter')
Beispiel #10
0
def to_month(date):
	try:
		return to_datetime(date).dt.month
	except:
		return lp_to_date_part(date=date, date_part='month')