@@ -64,7 +64,7 @@ class Resampler(_GroupBy):
64
64
'binner' , 'grouper' , 'groupby' ,
65
65
'sort' , 'kind' , 'squeeze' , 'keys' ,
66
66
'group_keys' , 'as_index' , 'exclusions' ,
67
- '_groupby' , '_from_selection' ]
67
+ '_groupby' ]
68
68
69
69
# don't raise deprecation warning on attributes starting with these
70
70
# patterns - prevents warnings caused by IPython introspection
@@ -85,14 +85,8 @@ def __init__(self, obj, groupby=None, axis=0, kind=None, **kwargs):
85
85
self .exclusions = set ()
86
86
self .binner = None
87
87
self .grouper = None
88
- self ._from_selection = False
89
88
90
89
if self .groupby is not None :
91
- # upsampling and PeriodIndex resampling do not work
92
- # if resampling on a column or mi level
93
- # this state used to catch and raise an error
94
- self ._from_selection = (self .groupby .key is not None or
95
- self .groupby .level is not None )
96
90
self .groupby ._set_grouper (self ._convert_obj (obj ), sort = True )
97
91
98
92
def __unicode__ (self ):
@@ -118,6 +112,15 @@ def _typ(self):
118
112
return 'series'
119
113
return 'dataframe'
120
114
115
+ @property
116
+ def _from_selection (self ):
117
+ """ is the resampling from a DataFrame column or MultiIndex level """
118
+ # upsampling and PeriodIndex resampling do not work
119
+ # with selection, this state used to catch and raise an error
120
+ return (self .groupby is not None and
121
+ (self .groupby .key is not None or
122
+ self .groupby .level is not None ))
123
+
121
124
def _deprecated (self , op ):
122
125
warnings .warn (("\n .resample() is now a deferred operation\n "
123
126
"You called {op}(...) on this deferred object "
0 commit comments