monthcalendar

python/pandas: convert month int to month name

Convert month int to month name in Pandas Question: I want to transform an integer between 1 and 12 into an abbrieviated month name. I have a df which looks like: client Month 1 sss 02 2 yyy 12 3 www 06 I want the df to look like this: client Month 1 sss Feb …

Total answers: 13

Best way to find the months between two dates

Best way to find the months between two dates Question: I have the need to be able to accurately find the months between two dates in python. I have a solution that works but its not very good (as in elegant) or fast. dateRange = [datetime.strptime(dateRanges[0], “%Y-%m-%d”), datetime.strptime(dateRanges[1], “%Y-%m-%d”)] months = [] tmpTime = dateRange[0] …

Total answers: 41