Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to change index date format pandas

df.index = df.index.strftime('%d/%m/%Y')
print (df)
            Col1  Col2
10/02/2017  val1  val1
09/02/2017  val2  val2
08/02/2017  val3  val3
07/02/2017  val4  val4

print (type(df.index[0]))
<class 'str'>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #index #date #format #pandas
ADD COMMENT
Topic
Name
1+2 =