The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
How to calculate no of day's present in month based on given date
sgnarkhede2016
Member Posts: 152 Contributor II
in Help
I have the requirement of finding a total number of days in a month based on date. For e.g I have a date with me i.e. 15 April 2021 then a number of days must return 30 as April month consists of 30 days. If I have a date of 02 Feb 2020 then the number of days should return as 29 as it is a leap year.
Can we achieve this in RapidMiner using any in-built function or operator?
0
Best Answers
-
ceaperez Member Posts: 541 UnicornHi @sgnarkhede2016,
You can use the pandas.Period.days_in_month method in a python script. operator.p = pd.Period('2021-4-21')p.days_in_monthreturn 30.please find attached an example process0 -
Telcontar120 RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 UnicornIf you don't want to use python you can also extract the month from the date (using Generate Attributes) and then a lookup table to join the number of days based on the month.0
Answers
Dortmund, Germany