Top "Dataframe" questions

A data frame is a 2D tabular data structure.

How to check if any value is NaN in a Pandas DataFrame

In Python Pandas, what's the best way to check whether a DataFrame has one (or more) NaN values? I know …

python pandas dataframe nan
Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()

Having issue filtering my result dataframe with an or condition. I want my result df to extract all column var …

python pandas dataframe boolean filtering
Convert a list to a data frame

I have a nested list of data. Its length is 132 and each item is a list of length 20. Is there …

r list dataframe
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 …

python pandas dataframe chained-assignment
Selecting a row of pandas series/dataframe by integer index

I am curious as to why df[2] is not supported, while df.ix[2] and df[2:3] both work. In [26]: df.ix[2] …

python pandas dataframe indexing
Use a list of values to select rows from a pandas dataframe

Lets say I have the following pandas dataframe: df = DataFrame({'A' : [5,6,3,4], 'B' : [1,2,3, 5]}) df A B 0 5 1 1 6 2 2 3 3 3 4 5 I can subset based on …

python pandas dataframe
How to count the NaN values in a column in pandas DataFrame

I want to find the number of NaN in each column of my data so that I can drop a …

python pandas dataframe
Select by partial string from a pandas DataFrame

I have a DataFrame with 4 columns of which 2 contain string values. I was wondering if there was a way to …

python string pandas dataframe
Pretty-print an entire Pandas Series / DataFrame

I work with Series and DataFrames on the terminal a lot. The default __repr__ for a Series returns a reduced …

python pandas dataframe
Convert Python dict into a dataframe

I have a Python dictionary like the following: {u'2012-06-08': 388, u'2012-06-09': 388, u'2012-06-10': 388, …

python pandas dataframe