Created
March 10, 2020 10:28
-
-
Save JulianWgs/d895269b5c3600428e36f06dec44ff02 to your computer and use it in GitHub Desktop.
Create index on hour range in pandas (date_range)
This file contains hidden or 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
# index are integers | |
# when the index is already a time delete unit arg | |
pd.date_range( | |
start=pd.to_datetime(df.columns.min(), unit="h"), | |
end=pd.to_datetime(df.columns.max(), unit="h"), | |
freq="1H" | |
).time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment