Skip to content

Tag: dataframe

Pandas – Groupby and Standardize

I have tried to tackle this for quite some time, but haven’t been able to get a pythonic way around it by using the built-in groupby and transform methods from pandas. The goal is to group the data by columns ex_date and id, then within the groups identified, standardize the column called ref_value_1 ag…

Clean Data using Pandas

I have the data in this format, and I want to turn it around in an horizontal shape, and in the same time accumulate the count of one product, when the date and hour data are the same. I put below the new desired data frame. Is this feasible using pandas? Or any other python library? Answer You could groupby+…

Create a Nested list from a pandas data frame

I am trying to create a kind of nested list from a pandas data frame. I have this data frame: So I want to create a kind of nested list using the above data frame using ‘id1’ column, and ‘Name1’ and ‘Name2’ columns. For example, if we think about the first row, id1 should b…