skimpy icon indicating copy to clipboard operation
skimpy copied to clipboard

TypeError: import_optional_dependency() got an unexpected keyword argument 'errors'

Open thdevine opened this issue 3 years ago • 0 comments

From my python (v 3.7) dev vm at work I pull data from Vertica (mysql) into a pandas df, and I get what smells like a dependency issue. If this is based on a pandas dependency, is it possible to use skimpy with a different version of pandas through some older version of skimpy?

I run: skim(df)

I get the issue: `--------------------------------------------------------------------------- TypeError Traceback (most recent call last) /tmp/ipykernel_xyz/myscript.py in ----> 1 skim(shipments) 2 # shipments.describe()

~/.venv/asdf/lib/python3.7/site-packages/typeguard/init.py in wrapper(*args, **kwargs) 1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs) 1032 check_argument_types(memo) -> 1033 retval = func(*args, **kwargs) 1034 try: 1035 check_return_type(retval, memo)

~/.venv/asdf/lib/python3.7/site-packages/skimpy/init.py in skim(df, header_style, **colour_kwargs) 527 xf = df.select_dtypes(col_type) 528 if not xf.empty: --> 529 sum_df = summary_func(xf) 530 list_of_tabs.append( 531 dataframe_to_rich_table(

~/.venv/asdf/lib/python3.7/site-packages/typeguard/init.py in wrapper(*args, **kwargs) 1031 memo = _CallMemo(python_func, _localns, args=args, kwargs=kwargs) 1032 check_argument_types(memo) -> 1033 retval = func(*args, **kwargs) 1034 try: 1035 check_return_type(retval, memo)

~/.venv/asdf/lib/python3.7/site-packages/skimpy/init.py in numeric_variable_summary_table(xf) 306 data_dict = { 307 "missing": count_nans_vec, --> 308 "complete rate": 1 - count_nans_vec / xf.shape[0], 309 NUM_COL_MEAN: xf.mean(), 310 "sd": xf.std(),

~/.venv/asdf/lib/python3.7/site-packages/pandas/core/ops/common.py in new_method(self, other) 63 break 64 if isinstance(other, cls): ---> 65 return NotImplemented 66 67 other = item_from_zerodim(other)

~/.venv/asdf/lib/python3.7/site-packages/pandas/core/arraylike.py in truediv(self, other) 111 def rmul(self, other): 112 return self._arith_method(other, roperator.rmul) --> 113 114 @unpack_zerodim_and_defer("truediv") 115 def truediv(self, other):

~/.venv/asdf/lib/python3.7/site-packages/pandas/core/series.py in _arith_method(self, other, op) 4996 0 True 4997 1 True -> 4998 2 True 4999 3 False 5000 4 True

~/.venv/asdf/lib/python3.7/site-packages/pandas/core/ops/array_ops.py in arithmetic_op(left, right, op) 187 Evaluate an arithmetic operation +, -, *, /, //, %, **, ... 188 --> 189 Note: the caller is responsible for ensuring that numpy warnings are 190 suppressed (with np.errstate(all="ignore")) if needed. 191

~/.venv/asdf/lib/python3.7/site-packages/pandas/core/ops/array_ops.py in _na_arithmetic_op(left, right, op, is_cmp) 137 138 def _na_arithmetic_op(left, right, op, is_cmp: bool = False): --> 139 """ 140 Return the result of evaluating op on the passed in values. 141

~/.venv/asdflib/python3.7/site-packages/pandas/core/computation/expressions.py in 17 from pandas._typing import FuncType 18 ---> 19 from pandas.core.computation.check import NUMEXPR_INSTALLED 20 from pandas.core.ops import roperator 21

~/.venv/data_analyses/lib/python3.7/site-packages/pandas/core/computation/check.py in 1 from pandas.compat._optional import import_optional_dependency 2 ----> 3 ne = import_optional_dependency("numexpr", errors="warn") 4 NUMEXPR_INSTALLED = ne is not None 5 if NUMEXPR_INSTALLED:

  TypeError: import_optional_dependency() got an unexpected keyword argument 'errors'`

thdevine avatar Jul 08 '22 20:07 thdevine