Top "Dataframe" questions

A data frame is a 2D tabular data structure.

Pandas index column title or name

How do I get the index column name in python pandas? Here's an example dataframe: Column 1 Index Title Apples 1 Oranges 2 …

python pandas dataframe columnname
How to filter Pandas dataframe using 'in' and 'not in' like in SQL

How can I achieve the equivalents of SQL's IN and NOT IN? I have a list with the required values. …

python pandas dataframe sql-function
How to apply a function to two columns of Pandas dataframe

Suppose I have a df which has columns of 'ID', 'col_1', 'col_2'. And I define a function : f = …

python pandas dataframe
How are iloc and loc different?

Can someone explain how these two methods of slicing are different? I've seen the docs, and I've seen these answers, …

python pandas indexing dataframe
What is the most efficient way to loop through dataframes with pandas?

I want to perform my own complex operations on financial data in dataframes in a sequential manner. For example I …

python pandas performance dataframe for-loop
How to take column-slices of dataframe in pandas

I load some machine learning data from a CSV file. The first 2 columns are observations and the remaining columns are …

python pandas numpy dataframe slice
Pandas DataFrame Groupby two columns and get counts

I have a pandas dataframe in the following format: df = pd.DataFrame([[1.1, 1.1, 1.1, 2.6, 2.5, 3.4,2.6,2.6,3.4,3.4,2.6,1.1,1.1,3.3], list('AAABBBBABCBDDD'), [1.1, 1.7, 2.5, 2.6, 3.3, 3.8,4.0,4.2,4.3,4.5,4.6,4.7,4.7,4.8], ['x/y/z','x/y','x/…

python pandas dataframe
UnicodeDecodeError when reading CSV file in Pandas with Python

I'm running a program which is processing 30,000 similar files. A random number of them are stopping and producing this error... …

python pandas csv dataframe unicode
How can a add a row to a data frame in R?

In R, how do you add a new row to a data frame once the data frame has already been …

r dataframe