Search
 
SCRIPT & CODE EXAMPLE
 

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'>
Comment

PREVIOUS NEXT
Code Example
Python :: types of dict comprehension 
Python :: python script as service linux 
Python :: tqdm range python 
Python :: python isinstance list 
Python :: keyboardinterrupt python 
Python :: how to change case of string in python 
Python :: numpy aray map values with dictionary 
Python :: dropna threshold 
Python :: django response headers 
Python :: python opencv subtract two images 
Python :: python - find specific name in a df 
Python :: extends template django 
Python :: merge two dataframes based on column 
Python :: list sort by key and value 
Python :: python 3.7 download for windows 7 32-bit 
Python :: end python print with space 
Python :: python sort the values in a dictionary 
Python :: Python, importing other scripts from other directories 
Python :: make the first letter of a string upper case 
Python :: run in thread decorator 
Python :: python offline translate pypi 
Python :: Game of Piles Version 2 codechef solution 
Python :: unique list values python ordered 
Python :: How to append train and Test dataset in python 
Python :: python subtract list from list 
Python :: jsonschema in python 
Python :: pandas dataframe to series 
Python :: downsample image opencv 
Python :: multiprocessing print does not work 
Python :: get last n in array python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =