A PyQT GUI application for converting InfoLease report outputs into Excel files. Handles parsing and summarizing. Learns where files are meant to be store and compiles monthly and yearly summaries.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
InfoLeaseExtract/venv/Lib/site-packages/pandas/_libs/reduction.pyx

33 lines
1.1 KiB

import numpy as np
cimport numpy as cnp
cnp.import_array()
from pandas._libs.util cimport is_array
cdef cnp.dtype _dtype_obj = np.dtype("object")
cpdef check_result_array(object obj, object dtype):
# Our operation is supposed to be an aggregation/reduction. If
# it returns an ndarray, this likely means an invalid operation has
# been passed. See test_apply_without_aggregation, test_agg_must_agg
if is_array(obj):
if dtype != _dtype_obj:
# If it is object dtype, the function can be a reduction/aggregation
# and still return an ndarray e.g. test_agg_over_numpy_arrays
raise ValueError("Must produce aggregated value")
cpdef inline extract_result(object res):
""" extract the result object, it might be a 0-dim ndarray
or a len-1 0-dim, or a scalar """
if hasattr(res, "_values"):
# Preserve EA
res = res._values
if res.ndim == 1 and len(res) == 1:
# see test_agg_lambda_with_timezone, test_resampler_grouper.py::test_apply
res = res[0]
return res