Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: pina versão pandas #1

Merged
merged 1 commit into from May 2, 2023
Merged

Conversation

daniloimparato
Copy link

@daniloimparato daniloimparato commented May 1, 2023

Corrige o erro

Traceback (most recent call last):
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1490, in array_func
    result = self.grouper._cython_operation(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 959, in _cython_operation
    return cy_op.cython_operation(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 657, in cython_operation
    return self._cython_op_ndim_compat(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 497, in _cython_op_ndim_compat
    return self._call_cython_op(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 541, in _call_cython_op
    func = self._get_cython_function(self.kind, self.how, values.dtype, is_numeric)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 173, in _get_cython_function
    raise NotImplementedError(
NotImplementedError: function is not implemented for this dtype: [how->mean,dtype->object]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 1692, in _ensure_numeric
    x = float(x)
ValueError: could not convert string to float: 'chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 1696, in _ensure_numeric
    x = complex(x)
ValueError: complex() arg is a malformed string

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/wf-cas9/bin/report.py", line 455, in <module>
    main()
  File "/data/wf-cas9/bin/report.py", line 433, in main
    make_target_summary_table(report, args.sample_ids, args.target_summary,
  File "/data/wf-cas9/bin/report.py", line 212, in make_target_summary_table
    read_len = df_on_off.groupby(['target']).mean()[['read_length']]
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1855, in mean
    result = self._cython_agg_general(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1507, in _cython_agg_general
    new_mgr = data.grouped_reduce(array_func)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 1503, in grouped_reduce
    applied = sb.apply(func)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/internals/blocks.py", line 329, in apply
    result = func(self.values, **kwargs)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1503, in array_func
    result = self._agg_py_fallback(values, ndim=data.ndim, alt=alt)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1457, in _agg_py_fallback
    res_values = self.grouper.agg_series(ser, alt, preserve_dtype=True)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 994, in agg_series
    result = self._aggregate_series_pure_python(obj, func)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 1015, in _aggregate_series_pure_python
    res = func(group)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/groupby.py", line 1857, in <lambda>
    alt=lambda x: Series(x).mean(numeric_only=numeric_only),
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/generic.py", line 11556, in mean
    return NDFrame.mean(self, axis, skipna, numeric_only, **kwargs)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/generic.py", line 11201, in mean
    return self._stat_function(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/generic.py", line 11158, in _stat_function
    return self._reduce(
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/series.py", line 4666, in _reduce
    return op(delegate, skipna=skipna, **kwds)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 96, in _f
    return f(*args, **kwargs)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 158, in f
    result = alt(values, axis=axis, skipna=skipna, **kwds)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 421, in new_func
    result = func(values, axis=axis, skipna=skipna, mask=mask, **kwargs)
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 727, in nanmean
    the_sum = _ensure_numeric(values.sum(axis, dtype=dtype_sum))
  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/nanops.py", line 1699, in _ensure_numeric
    raise TypeError(f"Could not convert {x} to numeric") from err
TypeError: Could not convert chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2chr2 to numeric

Sendo essa a parte relevante:

  File "/data/work/conda/epi2melabs-wf-cas9-e16d55f65a875f9075efd6576df63c51/lib/python3.10/site-packages/pandas/core/groupby/ops.py", line 173, in _get_cython_function
    raise NotImplementedError(
NotImplementedError: function is not implemented for this dtype: [how->mean,dtype->object]

Pandas passou por uma grande atualização (1.5.3 -> 2.0.1), quebrando retrocompatibilidade.

image

No screenshot abaixo, a provável causa do erro.

image

Issue relacionado: pandas-dev/pandas#52930

@lmtani
Copy link
Owner

lmtani commented May 2, 2023

LGTM!

@lmtani lmtani merged commit ffca653 into lmtani:master May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants