Top "Dataframe" questions

A data frame is a 2D tabular data structure.

Filter data.frame rows by a logical condition

I want to filter rows from a data.frame based on a logical condition. Let's suppose that I have data …

r dataframe subset r-faq
How to add pandas data to an existing csv file?

I want to know if it is possible to use the pandas to_csv() function to add a dataframe to …

python pandas csv dataframe
count number of rows in a data frame in R based on group

I have a data frame in R like this: ID MONTH-YEAR VALUE 110 JAN. 2012 1000 111 JAN. 2012 2000 . . . . 121 FEB. 2012 3000 131 FEB. 2012 4000 . . . . So, for each month …

r dataframe rowcount
How to check whether a pandas DataFrame is empty?

How to check whether a pandas DataFrame is empty? In my case I want to print some message in terminal …

python pandas dataframe
R - Concatenate two dataframes?

Given two dataframes a and b: > a a b c 1 -0.2246894 -1.48167912 -1.65099363 2 0.5559320 -0.87898575 -0.15634590 3 1.8469466 -0.01487524 -0.53098215 4 -0.6875051 0.23880967 0.01824621 5 -0.6735163 0.75485292 0.44154092 &…

r dataframe concatenation
How do I add a new column to a Spark DataFrame (using PySpark)?

I have a Spark DataFrame (using PySpark 1.5.1) and would like to add a new column. I've tried the following without …

python apache-spark dataframe pyspark apache-spark-sql
How to plot two columns of a pandas data frame using points?

I have a pandas data frame and would like to plot values from one column versus the values from another …

python matplotlib plot pandas dataframe
How to display pandas DataFrame of floats using a format string for columns?

I would like to display a pandas dataframe with a given format using print() and the IPython display(). For example: …

python python-2.7 pandas ipython dataframe
Concatenate columns in Apache Spark DataFrame

How do we concatenate two columns in an Apache Spark DataFrame? Is there any function in Spark SQL which we …

sql apache-spark dataframe apache-spark-sql
Re-ordering columns in pandas dataframe based on column name

I have a dataframe with over 200 columns. The issue is as they were generated the order is ['Q1.3','Q6.1…

python pandas dataframe