Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python add hyphen to string

> import datetime
> datetime.datetime.strptime('20110503','%Y%m%d').date().isoformat()
'2011-05-03'
#with pandas
c['date'] =  pd.to_datetime(c['date'], format = '%Y%m%d')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #add #hyphen #string
ADD COMMENT
Topic
Name
5+6 =