Code Monkey home page Code Monkey logo

Comments (5)

pwwang avatar pwwang commented on August 11, 2024

Looks like it's more of a problem for python3.8

In [1]: from datar.all import signif

In [2]: from datar import get_versions

In [3]: signif(0)
/path/to/lib/python3.9/site-packages/datar_numpy/api/arithm.py:156: RuntimeWarning: divide by zero encountered in log10
  digits = digits - np.ceil(np.log10(np.abs(x)))
/path/to/lib/python3.9/site-packages/datar_numpy/api/arithm.py:157: RuntimeWarning: invalid value encountered in cast
  digits = np.broadcast_arrays(0, digits.astype(int))
Out[3]: array(0)

In [4]: get_versions()
python      : 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:39:03) 
              [GCC 11.3.0]
datar       : 0.15.4
simplug     : 0.3.2
executing   : 2.0.1
pipda       : 0.13.1
datar-numpy : 0.3.2
numpy       : 1.24.4
datar-pandas: 0.5.4
pandas      : 2.1.1

Still need to eliminate the warnings though.

from datar.

pwwang avatar pwwang commented on August 11, 2024

Fixed by datar-numpy v0.3.3

Try pip install -U datar-numpy

from datar.

fkgruber avatar fkgruber commented on August 11, 2024

this. this update solves that issue with signif

from datar.

fkgruber avatar fkgruber commented on August 11, 2024

Now I have a different problem:

Python 3.8.18 (default, Sep 11 2023, 08:17:16) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os

>>> import os

import pandas as pd

>>> import numpy as np

from datar.all import tibble, mutate, bind_rows, f, tribble,select,signif,if_else,unite,distinct

>>> >>> >>> df=pd.DataFrame({'A':range(1,11),'B':np.random.randn(10)})
df>>mutate(B=signif(f.B,1))
>>> /Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/pipda/utils.py:82: PipeableCallCheckWarning: Failed to detect AST node calling `signif`, assuming a normal call.
  warnings.warn(
/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/pipda/utils.py:89: PipeableCallCheckWarning: Failed to detect AST node calling `mutate`, assuming a piping call.
  warnings.warn(
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/pipda/verb.py", line 73, in _pipda_eval
    return func(data, *self._pipda_args, **self._pipda_kwargs)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/datar_pandas/api/dplyr/mutate.py", line 62, in _mutate
    val = evaluate_expr(val, data, Context.EVAL)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/pipda/utils.py", line 124, in evaluate_expr
    return expr._pipda_eval(data, context)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/pipda/function.py", line 108, in _pipda_eval
    return impl(*args, **kwargs)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/datar_pandas/factory.py", line 115, in wrapper
    out = func(*args, **kwargs)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/datar_pandas/factory.py", line 324, in _pandasobject_apply
    return apply_df(args_frame, bound, exclude, func)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/functools.py", line 875, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/datar_pandas/factory.py", line 304, in apply_df
    return func(*bound.args, **bound.kwargs)
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/datar_numpy/api/arithm.py", line 156, in _signif
    if x == 0:
  File "/Users/fgruber/miniconda3/envs/benchmark/lib/python3.8/site-packages/pandas/core/generic.py", line 1466, in __nonzero__
    raise ValueError(
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
>>> 

from datar.

pwwang avatar pwwang commented on August 11, 2024

Fixed by datar-numpy v0.3.4

Try pip install -U datar-numpy

from datar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.