Comments (5)
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.
Fixed by datar-numpy v0.3.3
Try pip install -U datar-numpy
from datar.
this. this update solves that issue with signif
from datar.
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.
Fixed by datar-numpy v0.3.4
Try pip install -U datar-numpy
from datar.
Related Issues (20)
- [ENH] Support dplyr 1.0.9
- [ENH] Support dplyr 1.1.0~1.1.2
- [ENH] Support tidyr 1.3.0
- [ENH] Support forcats 1.0.0
- [BUG] if_else() is evaluating `true statement` even when the `condition` is `false` HOT 2
- [ENH] From "with_groups()" to "by" within verbs.... HOT 2
- [QST] error import filter HOT 1
- Cannot import name 'filter' from 'datar.dplyr' HOT 1
- [QST] Warning: PipeableCallCheckWarning: Failed to detect AST node calling `mutate`, assuming a piping call. HOT 6
- warning HOT 1
- [QST] How to use a custom function in mutate? HOT 6
- [ENH] Adding transformation functions oriented to modeling. HOT 2
- [BUG] warnings when using pipe HOT 1
- [ENH] Support for lets-plot HOT 3
- [QST] is asof join supported? HOT 4
- head does not work with pipe [BUG] HOT 1
- PipeableCallCheckWarning: Failed to detect AST node calling `xxx`, assuming a normal call
- how to use %in% HOT 1
- [BUG] incompatible with pandas 2.2.1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datar.