All Questions

133
votes
5answers
4743 views

How to make good reproducible pandas examples

Having spent a decent amount of time watching both the r and pandas tags on SO, the impression that I get is that pandas questions are less likely to contain reproducible data. This is something that ...
205
votes
7answers
185902 views

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 them like this: E:\FinReporter\FM_EXT.py:449: SettingWithCopyWarning: A val...
631
votes
12answers
181284 views

"Large data" work flows using pandas

I have tried to puzzle out an answer to this question for many months while learning pandas. I use SAS for my day-to-day work and it is great for it's out-of-core support. However, SAS is horrible a...
239
votes
7answers
150788 views

Filter dataframe rows if value in column is in a set list of values

I have a Python pandas DataFrame rpt: rpt <class 'pandas.core.frame.DataFrame'> MultiIndex: 47518 entries, ('000002', '20120331') to ('603366', '20091231') Data columns: STK_ID ...
488
votes
11answers
570967 views

Select rows from a DataFrame based on values in a column in pandas

How to select rows from a DataFrame based on values in some column in pandas? In SQL I would use: select * from table where colume_name = some_value. I tried to look at pandas documentation but d...
848
votes
21answers
957649 views

Renaming columns in pandas

I have a DataFrame using pandas and column labels that I need to edit to replace the original column labels. I'd like to change the column names in a DataFrame A where the original column names are:...
17
votes
3answers
3980 views

What is the difference between size and count in pandas?

That is the difference between groupby("x").count and groupby("x").size in pandas ? Does size just exclude nil ?
6
votes
5answers
853 views

Create Pandas DataFrame from txt file with specific pattern

I need to create a Pandas DataFrame based on a text file based on the following structure: Alabama[edit] Auburn (Auburn University)[1] Florence (University of ...
59
votes
1answers
815 views

How to pivot a dataframe

What is pivot? How do I pivot? Is this a pivot? Long format to wide format? I've seen a lot of questions that ask about pivot tables. Even if they don't know that they are asking about pivot table...
52
votes
8answers
37664 views

How to write to an existing excel file without overwriting data (using pandas)?

I use pandas to write to excel file in the following fashion: import pandas writer = pandas.ExcelWriter('Masterfile.xlsx') data_filtered.to_excel(writer, "Main", cols=['Diff1', 'Diff2']) writer.s...

Previous Next