Category "dataframe"

Is there an R function to convert 'flowFrame' structure of 'flowCore' package to a 'data.frame'?

Objective: To view .fcs data as a dataframe using R language. Flow Cytometry data comes in .fcs file format. The file is read in the flowFrame structure produce

Vaex copy columns between dataframes

I have a dataframe that I performed a filter on and then added some virtual columns. I wish to add those columns back in with the original data frame. Here is m

Python API Call: JSON to Pandas DF

I'm working on pulling data from a public API and converting the response JSON file to a Pandas Dataframe. I've written the code to pull the data and gotten a s

Adding new dataframe colonms using information extracted from the url in the url column, but the url could be missing information

Given: A pandas dataframe that contains a user_url column among other columns. Expectation: New columns added to the original dataframe where the columns are co

Pandas groupby feature question for output CSV

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

Create multiple DataFrames using data from an api

I'm using the world bank API to analyze data and I want to create multiple data frames with the same indicators for different countries. import wbgapi as wb imp

Removing nested variables if there are NAs in certain variables inside the nested variable

I have a dataframe that looks something like this: df <- data.frame(gvkey = c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6), date = c(01,02,03,01,02,03,01,02,03,01,0

Is there a way to validate data type lengths in Pandas when using the read_csv function?

I'm trying to put some sort of length validation for columns using Pandas. For example, let's say I have a csv named test.csv that has the following data within

Apply loc to the entire dataframe but one column (keep the one column as it was and not remove it)

I am trying to divide the entire dataframe by a fix number but I want to keep the 'Year' column as is. I tried dividing the entire df with 100 and then multiply

Pandas - Cross referencing with DatetimeIndex - Groupby

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

How can I apply the decile cuts from one dataframe to another using R

I have a dataframe (df1) and have calculated the deciles for each row using the following: #create a function to calculate the deciles decilefun <- function(

How to create a Dataframe from multiple dictionaries

I have a little issue with my the data I have (multiple dictionaries) to process and create a Dataframe from them. This what the data look like: print(data) 0

dataframe to save csv: not accumulating the records only saving the last dataframe group records

dataframe question in web scraping data group example:the first loop-eg:5 records, second loop-eg:3 records when I did my below code, the csv file was saved the

Mean calculation between dataframes in list in R

I have a list of dataframes that all have the same format (same number of rows, same number of columns and columns have the same name). I would like to create a

How to concatenate the values of a dataframe along column axis and fill missing values?

I really stuck in this problem for a long time. I have a data frame, I want to group the data based on the ids and then stick the values for each id together. H

How to deal with SettingWithCopyWarning in Pandas

Background I just upgraded my Pandas from 0.11 to 0.13.0rc1. Now, the application is popping out many new warnings. One of them like this: E:\FinReporter\FM_EXT

Save multiple dataframes to the same file, one after the other

Lets say I have three dfs x,y,z 0,1,1,1 1,2,2,2 2,3,3,3 a,b,c 0,4,4,4 1,5,5,5 2,6,6,6 d,e,f 0,7,7,7 1,8,8,8 2,9,9,9 How can I stick them all together so that

Generating a Non Linear equation in Python like an excel output

I have some sample data below: Freemium: 0.5, 0.3333 , 0.1666, 0.0466, 0.0466, 0.1, 0.1666, 0.3333, 0.5 Minutes:0, 60, 120 ,180 ,240 ,300 ,360 ,420, 480 I want

Need pandas groupby.count() or groupby.size.unstack() to output a dataframe I can use

So I need to count the number of occurrences of a value per year, per animal. I've managed to do it but it's outputting a single column kind of dataframe rather

How to unmelt a completely melted table

I have this dataframe df which I have melted and then using pd.pivot_table I am able to get the table structure back at least looking at the rows it seems so -