Oct 18, 2019
Updated: Mar 23, 2021
Before start machine learning and with python Pandas it is necessary to know the complete information regarding the Date and Time Functionality.
Here we will be working with some examples for your better understating the time and date and extract useful information from Date and time.
This function used to find result as per given directives, here we working with CSV, and simple python script and find a date, month as per the given date.
>>>date = '11/15/2019'
now we find the date and its day as per date
>>>dt = datetime.strptime(date, '%b')
Date formate, date = '11/15/2019'
>>>training = training= pd.read_csv('training.csv')
>>>months = pd.to_datetime(training['date']).dt.strftime('%b').unique()
>>>months_list = list(months)
It may help to data science when we need to plots data when the date was given but need days to set as a label then we need to find days from the date, here
Use some time to ticks graph:
>>>plt.xticks(np.arange(0, 5000, 1000), months_list)
Contact here, if you face any problem regarding python data science and machine learning.