Skip to content

Pandas display.date option not working #11501

Closed
@ProfPh

Description

@ProfPh

pandas: 0.17.0
python: 3.5.0.final.0

import pandas as pd

list1 = {"Date":["01/11/15"]} #1st November 2015
pd.set_option('display.date_dayfirst', True)
#pd.set_option('display.date_yearfirst', False)
df = pd.DataFrame(list1, columns=['Date'])
df['Date'] = pd.to_datetime(df['Date'], dayfirst = [True])
df1 = df.sort_values(['Date'], ascending=[True])

print(df1)

Prints:

        Date
0 2015-11-01

Setting both options to True and False doesn't work nor does only setting one. Printing df and df1 have the same result. And not specifying a dayfirst argument in pd.to_datetime doesn't change anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeEnhancementOutput-Formatting__repr__ of pandas objects, to_stringTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions