Пример #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)
Пример #2
0
def to_day(date):
	try:
		return to_datetime(date).dt.day
	except:
		return lp_to_date_part(date=date, date_part='day')
Пример #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)
Пример #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')
Пример #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)
Пример #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')
Пример #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)
Пример #8
0
def to_year(date):
	try:
		return to_datetime(date).dt.year
	except:
		return lp_to_date_part(date=date, date_part='year')
Пример #9
0
def to_quarter(date):
	try:
		return to_datetime(date).dt.quarter
	except:
		return lp_to_date_part(date=date, date_part='quarter')
Пример #10
0
def to_month(date):
	try:
		return to_datetime(date).dt.month
	except:
		return lp_to_date_part(date=date, date_part='month')