Top "Dataframe" questions

A data frame is a 2D tabular data structure.

Add column in dataframe from list

I have a dataframe with some columns like this: A B C 0 4 5 6 7 7 6 5 The possible range of values in A are …

python pandas dataframe
Count number of rows within each group

I have a dataframe and I would like to count the number of rows within each group. I reguarly use …

r dataframe aggregate r-faq
Update a dataframe in pandas while iterating row by row

I have a pandas data frame that looks like this (its a pretty big one) date exer exp ifor mat 1092 2014…

python pandas updates dataframe
What does axis in pandas mean?

Here is my code to generate a dataframe: import pandas as pd import numpy as np dff = pd.DataFrame(np.…

python pandas numpy dataframe
Call apply-like function on each row of dataframe with multiple arguments from each row

I have a dataframe with multiple columns. For each row in the dataframe, I want to call a function on …

r dataframe
Create empty data frame with column names by assigning a string vector?

Create an empty data frame: y <- data.frame() Assign x, a string vector, to y as its column …

r dataframe
Rename specific column(s) in pandas

I've got a dataframe called data. How would I rename the only one column header? For example gdp to log(…

python pandas dataframe rename
Spark DataFrame groupBy and sort in the descending order (pyspark)

I'm using pyspark(Python 2.7.9/Spark 1.3.1) and have a dataframe GroupObject which I need to filter & sort in the descending …

python apache-spark dataframe pyspark apache-spark-sql
Replacing blank values (white space) with NaN in pandas

I want to find all values in a Pandas dataframe that contain whitespace (any arbitrary amount) and replace those values …

python pandas dataframe
Split column at delimiter in data frame

I would like to split one column into two within at data frame based on a delimiter. For example, a|…

r dataframe