You have been subscribed to a public bug:

The .apply() function does not work for resample function in this release.
Here a code sample to reproduce the error:
#### Code
import numpy as np
import pandas as pd
from pandas.io import sql


rng = pd.date_range('1/1/2011', periods=72, freq='30s')
df2 = pd.DataFrame(np.random.randn(72),index=rng)
x=df2.resample('60s',closed='right',convention='start')#.apply(np.median)
print x.shape
y=df2.resample('60s',closed='right',convention='start',how='median')
print y.shape
z=df2.resample('60s',closed='right',convention='start').apply(np.median)
print z.shape
print z

print('stop')
#### Output
(37, 1)
(37, 1)
(1,)
The function how='median' is deprecate and .apply(np.median)should be used. But 
the result array when using the apply function always consists only of one 
line, when running on Ubuntu Mate (16.04 LTS).
On other systems the usage of how=xxx and .apply(xxx) is equivalent.

** Affects: pandas (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: dataframe pandas python
-- 
python-pandas 0.17.1-3ubuntu2 bug in functionality
https://bugs.launchpad.net/bugs/1728393
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to