Top "Dataframe" questions

A data frame is a 2D tabular data structure.

Pandas conditional creation of a series/dataframe column

I have a dataframe along the lines of the below: Type Set 1 A Z 2 B Z 3 B X 4 C Y …

python pandas numpy dataframe
Import multiple csv files into pandas and concatenate into one DataFrame

I would like to read several csv files from a directory into pandas and concatenate them into one big DataFrame. …

python pandas csv dataframe concatenation
Normalize columns of pandas data frame

I have a dataframe in pandas where each column has different value range. For example: df: A B C 1000 10 0.5 765 5 0.35 800 7 0.09 Any …

python pandas dataframe normalize
How to drop columns by name in a data frame

I have a large data set and I would like to read specific columns or drop all the others. data &…

r dataframe subset
Sample random rows in dataframe

I am struggling to find the appropriate function that would return a specified number of rows picked up randomly without …

r dataframe random r-faq
Filtering a data frame by values in a column

I am working with the dataset LearnBayes. For those that want to see the actual data: install.packages('LearnBayes') I …

r filter dataframe
Convert DataFrame column type from string to datetime, dd/mm/yyyy format

How can I convert a DataFrame column of strings (in dd/mm/yyyy format) to datetimes?

python pandas dataframe datetime-format python-datetime
How do I create test and train samples from one dataframe with pandas?

I have a fairly large dataset in the form of a dataframe and I was wondering how I would be …

python python-2.7 pandas dataframe
Pandas group-by and sum

I am using this data frame: Fruit Date Name Number Apples 10/6/2016 Bob 7 Apples 10/6/2016 Bob 8 Apples 10/6/2016 Mike 9 Apples 10/7/2016 Steve 10 Apples 10/7/2016 Bob 1 …

python pandas dataframe group-by aggregate
Determine the data types of a data frame's columns

I'm using R and have loaded data into a dataframe using read.csv(). How do I determine the data type …

r dataframe types