Proper formatting for DateTime Index
See original GitHub issueAs an extension to #2124, a warning can be included that assesses whether the date has been properly formatted. It might be useful to have certain default formats for dates that are passed in, such as mm/dd/YYYY %H:%M:%S
.
For example, in some cases, Pandas will infer the year 55 as 2055 and then 77 as 1977. This would entirely misconstrue the timeline of data. Users should be encouraged to format their datetime column/index to include the full year.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
pandas.DatetimeIndex.strftime — pandas 0.23.1 documentation
Return an Index of formatted strings specified by date_format, which supports the same string format as the python standard library.
Read more >How do I properly set the Datetimeindex for a Pandas ...
To simplify Kirubaharan's answer a bit: df['Datetime'] = pd.to_datetime(df['date'] + ' ' + df['time']) df = df.set_index('Datetime').
Read more >Tips on Working with Datetime Index in pandas - Sergi's Blog
Now when we have our data prepared we can play with Datetime Index. Selecting values. Although the default pandas datetime format is ISO8601...
Read more >Datetimeindex format - Using Streamlit
I'm using Streamlit for my Python Data Science Web Projects. So far, so good. But, why I get this format on my DateTime...
Read more >How to change the Pandas datetime format in Python?
The date-time default format is “YYYY-MM-DD”. Hence, December 8, 2020, in the date format will be presented as “2020-12-08”. The datetime format ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thehomebrewnerd thank you for that context. Good to know we have that support in woodwork currently.
I will close this and file a separate issue in woodwork to track a “smart inference” feature.
@dsherry @ParthivNaresh Would a Woodwork solution throw a warning/error if the datetime column is not properly formatted? Seems that we need a validation check for the Datetime Logical Type.