A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/15015 below:

handle exceptions in particular columns when .agg · Issue #15015 · pandas-dev/pandas · GitHub

followup to #14668

When you have an exception in some aggregation columns, need to be more friendly. We exclude them in .groupby aggs so need to do that here.

In [1]: df = tm.makeMixedDataFrame()

In [2]: df
Out[2]: 
     A    B     C          D
0  0.0  0.0  foo1 2009-01-01
1  1.0  1.0  foo2 2009-01-02
2  2.0  0.0  foo3 2009-01-05
3  3.0  1.0  foo4 2009-01-06
4  4.0  0.0  foo5 2009-01-07

In [3]: df.agg('sum')
Out[3]: 
A    10.0
B     2.0
dtype: float64

In [4]: df.agg(['sum'])
ValueError: no results

In [6]: df.agg(['min'])
Out[6]: 
       A    B     C          D
min  0.0  0.0  foo1 2009-01-01

so [4] should prob not happen


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4