Group series by axis.
519171
function groupSeriesByAxis(ecModel) {
    var result = [];
    var axisList = [];

    ecModel.eachSeriesByType('boxplot', function (seriesModel) {
        var baseAxis = seriesModel.getBaseAxis();
        var idx = zrUtil.indexOf(axisList, baseAxis);

        if (idx < 0) {
            idx = axisList.length;
            axisList[idx] = baseAxis;
            result[idx] = {axis: baseAxis, seriesModels: []};
        }

        result[idx].seriesModels.push(seriesModel);
    });

    return result;
}
1234163
def mad(self,x, axis=None):
        """"""
        return np.median(np.abs(x - np.median(x, axis)), axis)
165015
def plot_groups_all(self, fout_dir=".", **kws_pltargs): # GrouperUserGos
        """"""
        hdrgos = self.grprobj.get_hdrgos()
        pltargs = PltGroupedGosArgs(self.grprobj, fout_dir=fout_dir, **kws_pltargs)
        return self._plot_groups_hdrgos(hdrgos, pltargs)
169375
function groupSeries(ecModel) {
    var seriesGroupByCategoryAxis = {};
    var otherSeries = [];
    var meta = [];
    ecModel.eachRawSeries(function (seriesModel) {
        var coordSys = seriesModel.coordinateSystem;

        if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {
            var baseAxis = coordSys.getBaseAxis();
            if (baseAxis.type === 'category') {
                var key = baseAxis.dim + '_' + baseAxis.index;
                if (!seriesGroupByCategoryAxis[key]) {
                    seriesGroupByCategoryAxis[key] = {
                        categoryAxis: baseAxis,
                        valueAxis: coordSys.getOtherAxis(baseAxis),
                        series: []
                    };
                    meta.push({
                        axisDim: baseAxis.dim,
                        axisIndex: baseAxis.index
                    });
                }
                seriesGroupByCategoryAxis[key].series.push(seriesModel);
            }
            else {
                otherSeries.push(seriesModel);
            }
        }
        else {
            otherSeries.push(seriesModel);
        }
    });

    return {
        seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,
        other: otherSeries,
        meta: meta
    };
}
235181
def aggregate_group_loop(*args, **kwargs):
    """"""
    func = kwargs['func']
    del kwargs['func']
    return aggregate_np(*args, func=lambda x: func(x), **kwargs)
19697
def series_index(self, series):
        
        for idx, s in enumerate(self):
            if series is s:
                return idx
        raise ValueError('series not in chart data object')
150550
def series(self):
        ''''''
        data = self.values()
        if len(data):
            for c in range(self.count()):
                yield data[:, c]
        else:
            raise StopIteration
72269
def trend(self, **kwargs):
        ''''''
        return DataFrame({ name: series.trend(**kwargs) \
            for name, series in self.groups.iteritems() })
1165459
def forecast(self, horizon, **kwargs):
        ''''''
        return DataFrame({ name: series.forecast(horizon, **kwargs) \
            for name, series in self.groups.iteritems() })
896300
def sum(self, other):
        """"""
        return TimeSeries.merge(
            [self, other], operation=operations.ignorant_sum
        )
544054
def group_by(iterable, key_func):
    """"""
    groups = (
        list(sub) for key, sub in groupby(iterable, key_func)
    )
    return zip(groups, groups)
1030171
def get_group(self, t, i):
        """"""

        try:
            value = []
            if t in _DIGIT and t != '0':
                value.append(t)
                t = next(i)
                if t in _DIGIT:
                    value.append(t)
                else:
                    i.rewind(1)
        except StopIteration:
            pass
        return ''.join(value) if value else None
1373785
def _plot(self):
        """"""
        r_max = min(
            self.view.x(1) - self.view.x(0),
            (self.view.y(0) or 0) - self.view.y(1)
        ) / (2 * 1.05)
        for serie in self.series:
            self.dot(serie, r_max)
1328938
def tsplit(df, shape):
    """"""
    if isinstance(df, (pd.DataFrame, pd.Series)):
        return df.iloc[0:shape], df.iloc[shape:]
    else:
        return df[0:shape], df[shape:]
246695
function assembleOtherSeries(series) {
    return zrUtil.map(series, function (series) {
        var data = series.getRawData();
        var lines = [series.name];
        var vals = [];
        data.each(data.dimensions, function () {
            var argLen = arguments.length;
            var dataIndex = arguments[argLen - 1];
            var name = data.getName(dataIndex);
            for (var i = 0; i < argLen - 1; i++) {
                vals[i] = arguments[i];
            }
            lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));
        });
        return lines.join('\n');
    }).join('\n\n' + BLOCK_SPLITER + '\n\n');
}
79441
def agg(self, aggregations):
        
        check_type(aggregations, list)

        new_index = Index(np.array(aggregations, dtype=np.bytes_), np.dtype(np.bytes_))

        return _series_agg(self, aggregations, new_index)
274485
def apply(self, df):
        """"""

        if self.subset:
            if _axis_is_rows(self.axis):
                df = df[self.subset]
            if _axis_is_cols(self.axis):
                df = df.loc[self.subset]

        result = df.agg(self.func, axis=self.axis, *self.args, **self.kwargs)
        result.name = self.title
        return result