String operation: split according 2 separators? #1902
-
Hi, Please, is there a "compact" way to split strings when using 2 separators? In pandas, according documentation of import pandas as pd
s = pd.Series(["foo and bar plus baz"])
s.str.split(r"and|plus", expand=True)
Out[2]:
0 1 2
0 foo bar baz But if I do the same in vaex (which as I understand wraps pandas API according vaex doc?) import vaex as vx
vdf = vx.from_arrays(s=["foo and bar plus baz"])
vdf['s'].str.split(r"and|plus")
Out[7]:
Expression = str_split(s, 'and|plus')
Length: 1 dtype: list<item: string> (expression)
------------------------------------------------
0 ['foo and bar plus baz'] At the moment, I am chaining the import vaex as vx
vdf = vx.from_arrays(s=["foo and bar plus baz"])
vdf['s'].str.split("and").str.split("plus")
Out[8]:
Expression = str_split(str_split(s, 'and'), 'plus')
Length: 1 dtype: list<item: list<item: string>> (expression)
------------------------------------------------------------
0 [['foo '], [' bar ', ' baz']] Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hey! Vaex's |
Beta Was this translation helpful? Give feedback.
Hey!
Vaex's
str
operations are certainly not a wrapper around those from pandas. In what part of the docs did you read that?What you ask is not supported, for variety of reasons (not deemed efficient, variable number of columns etc).