Combine Year and Month Columns in Pandas

merge year and month post

In data analysis, the ability to combine year and month columns in Pandas is important. It opens doors to time-based insights, trend analysis, and precise data representations. Whether you are working with financial data, sales records, or any time series dataset, understanding how to merge year and month information effectively is a valuable skill.

Pandas, the Python library, has emerged as the go-to tool for data manipulation and analysis. With its intuitive functionalities and a vast community of users, Pandas has become an indispensable resource for data professionals. In this blog post, we will use Pandas to learn how to combine year and month columns enabling more informed data analysis. Let us harness the power of Pandas to master this aspect of data manipulation.

Read more

Pandas Convert Column to datetime – object/string, integer, CSV & Excel

pandas convert string to date

In Pandas, you can convert a column (string/object or integer type) to datetime using the to_datetime() and astype() methods. Furthermore, you can also specify the data type (e.g., datetime) when reading your data from an external source, such as CSV or Excel.  In this Pandas tutorial, we will learn how to convert a column, containing … Read more

How to Extract Day from Datetime in R with Examples

Learn how to extract days from datetime in R - lubridate - format - readr

In this short R tutorial, you will learn how to extract days from datetime in R. This tutorial will contain a couple of examples containing R code and comments about the code. Extracting days from datetime is a task that we may need to do whenever we are working with a dataset and you want to carry out a time series analysis but only want to include day, for example. It is, of course, possible to use the similar methods as in this post to extract timestamps from datetime, as well.


As R is a versatile statistical programming language, there are many ways to carry out this extraction task.  For instance, we can extract days with the format function. However, first we need to have converted a vector, or a column in a dataframe, to a as.POSIXct class. 

Read more