Skip to content

pandas reads my dates as text and sorting is wrong

lucia_fernandez0 views

I read a CSV exported from our shop. The order_date column looks like 03/11/2025 (day first), but pandas says the type is object and sorting puts 25/12/2025 before 03/11/2025. A few cells contain junk such as not a date.

How do I convert the column and keep track of the bad rows?

Loading the replies

Your reply

Be kind and specific. Read the community guidelines.

Choose what we may use. You can change this at any time with “Privacy choices” at the foot of every page. Details are in the Cookie policy and the Privacy policy.

Strictly necessary

Remembers your theme, the lessons you marked as done and this choice. It stays on your device, tracks nothing and cannot be switched off.

Always on
What exactly is collected, and why

Grokem’s own counts

Collects
The pages you open and how long you stay, how far you scroll, where you came from, your device type, browser, screen size, language and time zone. Your IP address is turned into a code that changes every day; it is never stored as it is.
Why
To see how long lessons are read and where readers leave. Not shared with anyone.
Stored
A random visitor ID, a visit ID and the time of your last page view in your browser’s storage (gr_vid, gr_sid, gr_last). No name or email is attached.
pandas reads my dates as text and sorting is wrong | Grokem