What is pivot? How do I pivot? Is this a pivot? Long format to wide format? I've seen a lot of questions that ask about pivot tables. Even if they don't know t
I imported a World Health Organization (WHO) csv file with Covid-19 cases per country from January 2020 into Mathematica. The file is a table with "Date Reporte
Say my data looks like this: date,name,id,dept,sale1,sale2,sale3,total_sale 1/1/17,John,50,Sales,50.0,60.0,70.0,180.0 1/1/17,Mike,21,Engg,43.0,55.0,2.0,100.0 1
My goal is to group a data frame DF by values of column Name and aggregate specific column as sum. Current data frame Name Val1 val2 val3 0 Test NaN 5 NaN 1 T
I have a DateFrame df which contains Open High Low Close Volume and Date data for every minute for the past ten days. **open** high low **close** volume
In Pandas, it is simple to slice a series(/array) such as [1,1,1,1,2,2,1,1,1,1] to return groups of [1,1,1,1], [2,2,],[1,1,1,1]. To do this, I use the syntax:
I am trying to figure out how to add row entries of the numeric columns(supply,demand) . I am at a complete loss. My initial thoughts are to do this with a dic
i am using pandas to read an excel file from s3 and i will be doing some operation in one of the column and write the new version in same location. Basically ne
I have the following id, i would like to groupby id and then replace value X with NaN. My current df. ID Date X other variables.. 1 1/1/18
I have a dataframe like this df = DataFrame({'Id':[1,2,3,3,4,5,6,6,6], 'Type': ['T1','T1','T2','T3','T2','T1','T1','T2','T3'],
I'm working with a DataFrame containing data as follows, and group the data two different ways. >>> d = { "A": [100]*7 + [200]*7, "B": ["one"
I have a df of customers CUST_ID | SEGMENT | AREA 1 | B | CAD 1 | A | RAM 2 | B | CAD 2 | C | RAM 3 | B
I have the following code df.groupby('AccountNumber')[['TotalStake','TotalPayout']].sum() which displays as I would like it to in pandas The issue is when I ou
I have data of many companies by month (End of Month). I want to create a new columns with groupby for each company where: new_col from Jul of this year to Jun
Below is a sample of pandas dataframe that I'm working with. I want to calculate mean absolute error for each row but only considering relevant columns for valu
I have a data frame consisting of some columns, where the index is datetime, i.e. it looks something like: df = col1 col2
I have a csv file having two columns i.e. imagename and ID. There are multiple image names for same ID as shown in picture. Number of image names against id is
I want to create two column from an existing column which contains nested list of list as values. Rows of record consisting of 3 companies participant and their
I notice several 'set value of new column based on value of another'-type questions, but from what I gather, I have not found that they address dividing values
I'm struggling to find a simple way to change a frequency of a pd.Series that is grouped on some level of a pd.MultiIndex (so it's a pd.core.groupby.generic.Ser