Created
October 1, 2018 10:08
-
-
Save Holt59/7eab90ff671c4a99c899ad92bd7e2a94 to your computer and use it in GitHub Desktop.
Pandas multicolumns dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import pandas as pd | |
s = """something a b c d message month day year | |
one 1 2 3.0 4 NaN 10 10 2018 | |
two 5 6 NaN 8 world 10 16 2018 | |
three 9 10 11.0 12 foo 11 15 2018""" | |
print(pd.read_table(io.StringIO(s), sep=' ', parse_dates={'date': ['month', 'day', 'year']})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment