Skip to content

Instantly share code, notes, and snippets.

@ycui1
Created November 5, 2021 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ycui1/ef86b51cda9f290f1dedc1650f89d438 to your computer and use it in GitHub Desktop.
Save ycui1/ef86b51cda9f290f1dedc1650f89d438 to your computer and use it in GitHub Desktop.
>>> from datetime import datetime
>>> pd.read_csv("custom_dt_fmt.csv", parse_dates=["date"], date_parser=lambda x: datetime.strptime(x, "%b_%d_%Y"))
date category balance
0 2022-01-01 A 100
1 2022-02-02 B 200
2 2022-03-12 C 300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment