I have an excel file that its first column is written as 31.12.2018 23.30 and it continues for a year. how can I convert this in python in order to change it in a way that I could get the year, month, day, and hour separately. I want to use it for a machine learning project to see whether my time series data is stationary or non_stationary.
1 Answer
You can use openpyxl.
You can load an excel sheet using it and get data from it.
Example:
>>> from openpyxl import load_workbook
>>> wb2 = load_workbook("file.xlsx")
>>> print(wb2.sheetnames)
['Sheet2', 'New Title', 'Sheet1']
pandaslibrary. That would be the best way to achieve what you are trying to do.