VAEX表达式选择所有行

发布于 2025-01-25 03:19:51 字数 280 浏览 0 评论 0原文

在VAEX中,哪些表达式可以用作滤波器选择所有行?我希望将过滤器作为变量创建并传递给函数。

filter = True
if x > 5:
 filter = y > 20
df['new_col'] = filter & z < 10

我的希望是,如果X&lt; = 5它将忽略过滤器(因此我试图将TRUE用作值)。这样做的方式给出了错误'bitwise_and'and'不支持输入类型,并且根据铸件规则'safe'''所有行?

In Vaex, what expression can be used as a filter to select all rows? I wish to create a filter as a variable and pass that to a function.

filter = True
if x > 5:
 filter = y > 20
df['new_col'] = filter & z < 10

My wish is that if x <= 5 it will ignore the filter (thus I'm trying to use True as a value). Doing it this way gives the error 'bitwise_and' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' What expression will select all rows?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

网名女生简单气质 2025-02-01 03:19:51

如果我正确理解一个简单的技巧,可以“禁用”所有过滤器(即所有的行回),就是做一些事情,例如

df[True | filter]

使条件始终为真,所以什么也没有过滤。

If I understand correctly a simple trick to "disable" all filters (i.e. get all rows back) is to do something like

df[True | filter]

Making the condition always True, so nothing is filtered out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文