Check Date is Valid in Python and Increment Date || GENERAL PYTHON PROGRAMMING QUESTION(Part 1)

preview_player
Показать описание
For aspiring Data Scientists, Python is probably the most important language to learn because of its rich ecosystem. Python's major advantage is its breadth. For example, R can run Machine Learning algorithms on a preprocessed dataset, but Python is much better at processing the data.

Why You Must Consider Writing Software Applications in Python:
1) Readable and Maintainable Code
2) Multiple Programming Paradigms
3) Compatible with Major Platforms and Systems
4) Robust Standard Library
5) Many Open Source Frameworks and Tools
6) Simplify Complex Software Development
7) Adopt Test Driven Development

Python program to check if a Date is Valid and get the Incremented Date (Part 1)

Please like and comment on this video and subscribe to this channel. :-)

By,
Sagar Bhalke and Divesh R. Kubal
Рекомендации по теме
Комментарии
Автор

Excellent . how to check date pattern in dataframe convert date as YYYY-MM-DD format. Example below

a dataframe which is coming through read_csv having 3 date columns with different date format as below

hiredate = dd-mmm-yyyy
report_date=dd/mm/yy
end_date = mmm/yyyy



input data

empid, ename, hiredate, report_date, end_date
1, sreenu, 17-oct-2020, 18/10/20, Jun-2021

I want create a method/function to check date format in df, then apply below rule to convert date YYYY-MM-DD format using python

if date is MMM-YYYY then display last day of the month else convert YYYY-MM-DD format.

output df

empid, ename, hiredate, report_date, end_date
1, sreenu, 2020-10-17, 2020-10-18, 2021-06-30

kottakaburlu