Tag Archives: reshape

Manipulating data with Pandas – Part 1

Pandas (i.e. panel data) is a Python library designed to manipulate data in tables and time series. Pandas uses many Numpy library functions to manipulate data stored in dataframes, analogous to a spreadsheet or table. Let’s look at some basic Pandas functions to manipulate data, and plot the data using the Seaborn plotting package. To begin, import libraries and simulate

Read more

R: How to reshape data from wide to long format, and back again

Many studies take repeated observations on subjects. For example, clinical trials record outcomes from subjects before and after treatments, and laboratory studies might record physiological outcomes from the same subjects over time. In a dataframe, when observations from each subject are written on one row and repeated observations are stored as different column variables, we say the data are in

Read more