Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

week of the year pandas

from datetime import date
df_date = pd.DataFrame([date.today()],columns  = ['today'])
print(df_date)
#### Print Output ####
#        today
#0  2019-09-07
df_date['weeknum'] = df_date.today.apply(lambda x:x.isocalendar()[1])
print(df_date)
#### Print Output ####
#        today  weeknum
#0  2019-09-07       36
Comment

PREVIOUS NEXT
Code Example
Python :: Get current cursor type and color Tkinter Python 
Python :: python .nlargest 
Python :: read dict from text 
Python :: how to check all the elements in a list are even or not 
Python :: create dict from two lists 
Python :: count nan values 
Python :: python makedir 
Python :: python function vs lambda 
Python :: save object pickle python 
Python :: python exec script 
Python :: python define class 
Python :: what is cross entropy loss in pytorch example 
Python :: numpy diff 
Python :: max value indices 
Python :: how to take first digit of number python 
Python :: pandas if else 
Python :: getenv python 
Python :: play video in python console 
Python :: post request socket python 
Python :: pytest teardown method 
Python :: python create temp file 
Python :: pandas convert string column to int list column 
Python :: Filter with List Comprehension 
Python :: how to download packages using pip 
Python :: start process python 
Python :: edit error page flask 
Python :: How to calculate distance without numpy 
Python :: continue statement python 
Python :: Python numpy.flatiter function Example 
Python :: python squared math function 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =