Methods
as_date
Parse a string and return a date.
as_time
Parse a string and return a time.
as_timestamp
Parse a string and return a timestamp.
ascii_str
Return the numeric ASCII code of the first character of a string.
authority
Parse a URL and extract authority.
capitalize
Uppercase the first letter, lowercase the rest.
concat
Concatenate strings.
contains
Return whether the expression contains substr.
convert_base
Convert a string representing an integer from one base to another.
endswith
Determine if self ends with end.
file
Parse a URL and extract file.
find
Return the position of the first occurrence of substring.
find_in_set
Find the first occurrence of str_list within a list of strings.
fragment
Parse a URL and extract fragment identifier.
hashbytes
Compute the binary hash value of the input.
hexdigest
Return the hash digest of the input as a hex encoded string.
host
Parse a URL and extract host.
ilike
Match patterns against self, case-insensitive.
join
Join a list of strings using self as the separator.
left
Return the nchars left-most characters.
length
Compute the length of a string.
levenshtein
Return the Levenshtein distance between two strings.
like
Match patterns against self, case-sensitive.
lower
Convert string to all lowercase.
lpad
Pad arg by truncating on the right or padding on the left.
lstrip
Remove whitespace from the left side of string.
path
Parse a URL and extract path.
protocol
Parse a URL and extract protocol.
query
Parse a URL and returns query string or query string parameter.
re_extract
Return the specified match at index from a regex pattern.
re_replace
Replace all matches found by regex pattern with replacement.
re_search
Return whether self contains the regex pattern.
re_split
Split a string by a regular expression pattern.
repeat
Repeat a string n times.
replace
Replace each exact match of pattern with replacement.
reverse
Reverse the characters of a string.
right
Return up to nchars from the end of each string.
rpad
Pad self by truncating or padding on the right.
rstrip
Remove whitespace from the right side of string.
split
Split as string on delimiter.
startswith
Determine whether self starts with start.
strip
Remove whitespace from left and right sides of a string.
substr
Extract a substring.
translate
Replace from_str characters in self characters in to_str.
upper
Convert string to all uppercase.
userinfo
Parse a URL and extract user info.
as_date
Parse a string and return a date.
Parameters
format_str
str
Format string in strptime format
required
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"ts" : ["20170206" ]})
t.ts.as_date("%Y%m %d " )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringToDate(ts, '%Y%m%d') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ date โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 2017-02-06 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
as_time
Parse a string and return a time.
Parameters
format_str
str
Format string in strptime format
required
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"ts" : ["20:01:02" ]})
t.ts.as_time("%H:%M:%S" )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringToTime(ts, '%H:%M:%S') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ time โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 20:01:02 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
as_timestamp
as_timestamp(format_str, / )
Parse a string and return a timestamp.
Parameters
format_str
str
Format string in strptime format
required
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"ts" : ["20170206" ]})
t.ts.as_timestamp("%Y%m %d " )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringToTimestamp(ts, '%Y%m%d') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ timestamp('UTC') โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 2017-02-06 00:00:00+00:00 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ascii_str
Return the numeric ASCII code of the first character of a string.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "def" , "ghi" ]})
t.s.ascii_str()
โโโโโโโโโโโโโโโโโโ
โ StringAscii(s) โ
โกโโโโโโโโโโโโโโโโโฉ
โ int32 โ
โโโโโโโโโโโโโโโโโโค
โ 97 โ
โ 100 โ
โ 103 โ
โโโโโโโโโโโโโโโโโโ
authority
Parse a URL and extract authority.
Examples
import ibis
url = ibis.literal("https://user:pass@example.com:80/docs/books" )
result = url.authority() # user:pass@example.com:80
capitalize
Uppercase the first letter, lowercase the rest.
This API matches the semantics of the Python str.capitalize method.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["aBC" , " abc" , "ab cd" , None ]})
t.s.capitalize()
โโโโโโโโโโโโโโโโโ
โ Capitalize(s) โ
โกโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโค
โ Abc โ
โ abc โ
โ Ab cd โ
โ NULL โ
โโโโโโโโโโโโโโโโโ
concat
Concatenate strings.
NULLs are propagated. This methods is equivalent to using the + operator.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , None ]})
t.s.concat("xyz" , "123" )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringConcat((s, 'xyz', '123')) โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ abcxyz123 โ
โ NULL โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringConcat((s, 'xyz')) โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ abcxyz โ
โ NULL โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
contains
Return whether the expression contains substr.
Returns
BooleanValue
Boolean indicating the presence of substr in the expression
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["bab" , "ddd" , "eaf" ]})
t.s.contains("a" )
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringContains(s, 'a') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ boolean โ
โโโโโโโโโโโโโโโโโโโโโโโโโโค
โ True โ
โ False โ
โ True โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
convert_base
convert_base(from_base, to_base)
Convert a string representing an integer from one base to another.
Parameters
from_base
int | ir.IntegerValue
Numeric base of the expression
required
to_base
int | ir.IntegerValue
New base
required
endswith
Determine if self ends with end.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["Ibis project" , "GitHub" ]})
t.s.endswith("project" )
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EndsWith(s, 'project') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ boolean โ
โโโโโโโโโโโโโโโโโโโโโโโโโโค
โ True โ
โ False โ
โโโโโโโโโโโโโโโโโโโโโโโโโโ
file
Parse a URL and extract file.
Examples
import ibis
url = ibis.literal(
"https://example.com:80/docs/books/tutorial/index.html?name=networking"
)
result = url.file () # docs/books/tutorial/index.html?name=networking
find
find(sub, start= None , end= None , / )
Return the position of the first occurrence of substring.
Parameters
sub
str | StringValue | Deferred
Substring to search for
required
start
int | ir.IntegerValue | Deferred | None
Zero based index of where to start the search
None
end
int | ir.IntegerValue | Deferred | None
Zero based index of where to stop the search. Currently not implemented.
None
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "bac" , "bca" ]})
t.s.find("a" )
โโโโโโโโโโโโโโโโโโโโโโ
โ StringFind(s, 'a') โ
โกโโโโโโโโโโโโโโโโโโโโโฉ
โ int64 โ
โโโโโโโโโโโโโโโโโโโโโโค
โ 0 โ
โ 1 โ
โ 2 โ
โโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโ
โ StringFind(s, 'z') โ
โกโโโโโโโโโโโโโโโโโโโโโฉ
โ int64 โ
โโโโโโโโโโโโโโโโโโโโโโค
โ -1 โ
โ -1 โ
โ -1 โ
โโโโโโโโโโโโโโโโโโโโโโ
find_in_set
Find the first occurrence of str_list within a list of strings.
No string in str_list can have a comma.
Returns
IntegerValue
Position of str_list in self. Returns -1 if self isnโt found or if self contains ','.
Examples
import ibis
table = ibis.table(dict (string_col= "string" ))
result = table.string_col.find_in_set(["a" , "b" ])
fragment
Parse a URL and extract fragment identifier.
Examples
import ibis
url = ibis.literal("https://example.com:80/docs/#DOWNLOADING" )
result = url.fragment() # DOWNLOADING
hashbytes
hashbytes(how= 'sha256' , / )
Compute the binary hash value of the input.
Parameters
how
Literal ['md5', 'sha1', 'sha256', 'sha512']
Hash algorithm to use
'sha256'
Returns
BinaryValue
Binary expression
Examples
import ibis
str_lit = ibis.literal("hello" )
result = str_lit.hashbytes("md5" ) # b']A@*\xbcK*v\xb9q\x9d\x91\x10\x17\xc5\x92'
hexdigest
hexdigest(how= 'sha256' , / )
Return the hash digest of the input as a hex encoded string.
Parameters
how
Literal ['md5', 'sha1', 'sha256', 'sha512']
Hash algorithm to use
'sha256'
Returns
StringValue
Hexadecimal representation of the hash as a string
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"species" : ["Adelie" , "Chinstrap" , "Gentoo" ]})
t.species.hexdigest()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HexDigest(species) โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ a4d7d46b27480037bc1e513e0e157cbf258baae6ee69e3110d0f9ff418b57a3c โ
โ cb97d113ca69899ae4f1fb581f4a90d86989db77b4a33873d604b0ee412b4cc9 โ
โ b5e90cdff65949fe6bc226823245f7698110e563a12363fc57b3eed3e4a0a612 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
host
Parse a URL and extract host.
Examples
import ibis
url = ibis.literal("https://user:pass@example.com:80/docs/books" )
result = url.host() # example.com
ilike
Match patterns against self, case-insensitive.
This function is modeled after SQLโs ILIKE directive. Use % as a multiple-character wildcard or _ as a single-character wildcard.
Use re_search or rlike for regular expression-based matching.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["Ibis project" , "GitHub" ]})
t.s.ilike("%PROJect" )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringSQLILike(s, '%PROJect') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ boolean โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ True โ
โ False โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
join
Join a list of strings using self as the separator.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"arr" : [["a" , "b" , "c" ], None , [], ["b" , None ]]})
t
โโโโโโโโโโโโโโโโโโโโโโ
โ arr โ
โกโโโโโโโโโโโโโโโโโโโโโฉ
โ array<string> โ
โโโโโโโโโโโโโโโโโโโโโโค
โ [ 'a' , 'b' , ... +1 ] โ
โ NULL โ
โ [] โ
โ [ 'b' , None ] โ
โโโโโโโโโโโโโโโโโโโโโโ
ibis.literal("|" ).join(t.arr)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ArrayStringJoin(arr, '|') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ a|b|c โ
โ NULL โ
โ NULL โ
โ b โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
left
Return the nchars left-most characters.
Parameters
nchars
int | ir.IntegerValue | Deferred
Maximum number of characters to return
required
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "defg" , "hijlk" ]})
t.s.left(2 )
โโโโโโโโโโโโโโโโโโโโโโ
โ Substring(s, 0, 2) โ
โกโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโค
โ ab โ
โ de โ
โ hi โ
โโโโโโโโโโโโโโโโโโโโโโ
length
Compute the length of a string.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["aaa" , "a" , "aa" ]})
t.s.length()
โโโโโโโโโโโโโโโโโโโ
โ StringLength(s) โ
โกโโโโโโโโโโโโโโโโโโฉ
โ int32 โ
โโโโโโโโโโโโโโโโโโโค
โ 3 โ
โ 1 โ
โ 2 โ
โโโโโโโโโโโโโโโโโโโ
levenshtein
Return the Levenshtein distance between two strings.
Examples
import ibis
ibis.options.interactive = True
s = ibis.literal("kitten" )
s.levenshtein("sitting" )
โโโโโ
โ 3 โ
โโโโโ
like
Match patterns against self, case-sensitive.
This function is modeled after the SQL LIKE directive. Use % as a multiple-character wildcard or _ as a single-character wildcard.
Use re_search or rlike for regular expression-based matching.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["Ibis project" , "GitHub" ]})
t.s.like("%project" )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringSQLLike(s, '%project') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ boolean โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ True โ
โ False โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
lower
Convert string to all lowercase.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["AAA" , "a" , "AA" ]})
t
โโโโโโโโโโ
โ s โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ AAA โ
โ a โ
โ AA โ
โโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โ Lowercase(s) โ
โกโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโค
โ aaa โ
โ a โ
โ aa โ
โโโโโโโโโโโโโโโโ
lpad
lpad(width, fillchar= ' ' , / )
Pad arg by truncating on the right or padding on the left.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "def" , "ghij" ]})
t.s.lpad(5 , "-" )
โโโโโโโโโโโโโโโโโโโ
โ LPad(s, 5, '-') โ
โกโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโค
โ --abc โ
โ --def โ
โ -ghij โ
โโโโโโโโโโโโโโโโโโโ
lstrip
Remove whitespace from the left side of string.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : [" \t a \t " , " \n b \n " , " \v c \t " ]})
t
โโโโโโโโโโ
โ s โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ \t a \t โ
โ \n b \n โ
โ \v c \t โ
โโโโโโโโโโ
โโโโโโโโโโโโโ
โ LStrip(s) โ
โกโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโค
โ a \t โ
โ b \n โ
โ c \t โ
โโโโโโโโโโโโโ
path
Parse a URL and extract path.
Examples
import ibis
url = ibis.literal(
"https://example.com:80/docs/books/tutorial/index.html?name=networking"
)
result = url.path() # docs/books/tutorial/index.html
protocol
Parse a URL and extract protocol.
Examples
import ibis
url = ibis.literal("https://user:pass@example.com:80/docs/books" )
result = url.protocol() # https
query
Parse a URL and returns query string or query string parameter.
If key is passed, return the value of the query string parameter named. If key is absent, return the query string.
Examples
import ibis
url = ibis.literal(
"https://example.com:80/docs/books/tutorial/index.html?name=networking"
)
result = url.query() # name=networking
query_name = url.query("name" ) # networking
re_replace
re_replace(pattern, replacement)
Replace all matches found by regex pattern with replacement.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "bac" , "bca" , "this has multi \t whitespace" ]})
s = t.s
Replace all โaโs that are at the beginning of the string with โbโ:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RegexReplace(s, '^a', 'b') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ bbc โ
โ bac โ
โ bca โ
โ this has multi \t whitespace โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Double up any โaโs or โbโs, using capture groups and backreferences:
s.re_replace("([ab])" , r" \0\0 " )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RegexReplace(s, '()', '\\0\\0') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ aabbc โ
โ bbaac โ
โ bbcaa โ
โ this haas multi \t whitespaace โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Normalize all whitespace to a single space:
s.re_replace(r" \s + " , " " )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RegexReplace(s, '\\s+', ' ') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ abc โ
โ bac โ
โ bca โ
โ this has multi whitespace โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
re_search
Return whether self contains the regex pattern.
Returns True if the regex matches any part of a string and False otherwise.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["Ibis project" , "GitHub" , "GitHub Actions" ]})
t.s.re_search(".+Hub" )
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RegexSearch(s, '.+Hub') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ boolean โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ False โ
โ True โ
โ True โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
re_split
Split a string by a regular expression pattern.
Returns
ArrayValue
Array of strings from splitting by pattern
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable(dict (s= ["a.b" , "b.....c" , "c.........a" , "def" ]))
t.s
โโโโโโโโโโโโโโโ
โ s โ
โกโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโค
โ a.b โ
โ b.....c โ
โ c.........a โ
โ def โ
โโโโโโโโโโโโโโโ
t.s.re_split(r" \. + " ).name("splits" )
โโโโโโโโโโโโโโโโโ
โ splits โ
โกโโโโโโโโโโโโโโโโฉ
โ array<string> โ
โโโโโโโโโโโโโโโโโค
โ [ 'a' , 'b' ] โ
โ [ 'b' , 'c' ] โ
โ [ 'c' , 'a' ] โ
โ [ 'def' ] โ
โโโโโโโโโโโโโโโโโ
repeat
Repeat a string n times.
Parameters
n
int | ir.IntegerValue | Deferred
Number of repetitions
required
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["a" , "bb" , "c" ]})
t.s.repeat(5 )
โโโโโโโโโโโโโโโโ
โ Repeat(s, 5) โ
โกโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโค
โ aaaaa โ
โ bbbbbbbbbb โ
โ ccccc โ
โโโโโโโโโโโโโโโโ
replace
replace(pattern, replacement)
Replace each exact match of pattern with replacement.
This method transforms strings to strings. For replacing arbitrary types, see Value.substitute .
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "bac" , "bca" ]})
t.s.replace("b" , "z" )
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringReplace(s, 'b', 'z') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ azc โ
โ zac โ
โ zca โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
reverse
Reverse the characters of a string.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "def" , "ghi" ]})
t
โโโโโโโโโโ
โ s โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ abc โ
โ def โ
โ ghi โ
โโโโโโโโโโ
โโโโโโโโโโโโโโ
โ Reverse(s) โ
โกโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโค
โ cba โ
โ fed โ
โ ihg โ
โโโโโโโโโโโโโโ
right
Return up to nchars from the end of each string.
Parameters
nchars
int | ir.IntegerValue | Deferred
Maximum number of characters to return
required
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "defg" , "hijlk" ]})
t.s.right(2 )
โโโโโโโโโโโโโโโโโโ
โ StrRight(s, 2) โ
โกโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโค
โ bc โ
โ fg โ
โ lk โ
โโโโโโโโโโโโโโโโโโ
rpad
rpad(width, fillchar= ' ' , / )
Pad self by truncating or padding on the right.
Parameters
self
String to pad
required
width
int | ir.IntegerValue | Deferred
Length of output string
required
fillchar
str | StringValue
Pad character
' '
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "def" , "ghij" ]})
t.s.rpad(5 , "-" )
โโโโโโโโโโโโโโโโโโโ
โ RPad(s, 5, '-') โ
โกโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโค
โ abc-- โ
โ def-- โ
โ ghij- โ
โโโโโโโโโโโโโโโโโโโ
rstrip
Remove whitespace from the right side of string.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : [" \t a \t " , " \n b \n " , " \v c \t " ]})
t
โโโโโโโโโโ
โ s โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ \t a \t โ
โ \n b \n โ
โ \v c \t โ
โโโโโโโโโโ
โโโโโโโโโโโโโ
โ RStrip(s) โ
โกโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโค
โ \t a โ
โ \n b โ
โ \v c โ
โโโโโโโโโโโโโ
split
Split as string on delimiter.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"col" : ["a,b,c" , "d,e" , "f" ]})
t
โโโโโโโโโโ
โ col โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ a,b,c โ
โ d,e โ
โ f โ
โโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ StringSplit(col, ',') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ array<string> โ
โโโโโโโโโโโโโโโโโโโโโโโโโค
โ [ 'a' , 'b' , ... +1 ] โ
โ [ 'd' , 'e' ] โ
โ [ 'f' ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโ
startswith
Determine whether self starts with start.
Returns
BooleanValue
Boolean indicating whether self starts with start
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["Ibis project" , "GitHub" ]})
t.s.startswith("Ibis" )
โโโโโโโโโโโโโโโโโโโโโโโโโ
โ StartsWith(s, 'Ibis') โ
โกโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ boolean โ
โโโโโโโโโโโโโโโโโโโโโโโโโค
โ True โ
โ False โ
โโโโโโโโโโโโโโโโโโโโโโโโโ
strip
Remove whitespace from left and right sides of a string.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : [" \t a \t " , " \n b \n " , " \v c \t " ]})
t
โโโโโโโโโโ
โ s โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ \t a \t โ
โ \n b \n โ
โ \v c \t โ
โโโโโโโโโโ
โโโโโโโโโโโโ
โ Strip(s) โ
โกโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโค
โ a โ
โ b โ
โ c โ
โโโโโโโโโโโโ
substr
substr(start, length= None )
Extract a substring.
Parameters
start
int | ir.IntegerValue | Deferred
First character to start splitting, indices start at 0
required
length
int | ir.IntegerValue | Deferred | None
Maximum length of each substring. If not supplied, searches the entire string
None
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["abc" , "defg" , "hijlk" ]})
t.s.substr(2 )
โโโโโโโโโโโโโโโโโโโ
โ Substring(s, 2) โ
โกโโโโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโโโโค
โ c โ
โ fg โ
โ jlk โ
โโโโโโโโโโโโโโโโโโโ
translate
translate(from_str, to_str)
Replace from_str characters in self characters in to_str.
To avoid unexpected behavior, from_str should be shorter than to_str.
Parameters
from_str
StringValue
Characters in arg to replace
required
to_str
StringValue
Characters to use for replacement
required
Examples
import ibis
table = ibis.table(dict (string_col= "string" ))
result = table.string_col.translate("a" , "b" )
upper
Convert string to all uppercase.
Examples
import ibis
ibis.options.interactive = True
t = ibis.memtable({"s" : ["aaa" , "A" , "aa" ]})
t
โโโโโโโโโโ
โ s โ
โกโโโโโโโโโฉ
โ string โ
โโโโโโโโโโค
โ aaa โ
โ A โ
โ aa โ
โโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โ Uppercase(s) โ
โกโโโโโโโโโโโโโโโฉ
โ string โ
โโโโโโโโโโโโโโโโค
โ AAA โ
โ A โ
โ AA โ
โโโโโโโโโโโโโโโโ
userinfo
Parse a URL and extract user info.
Examples
import ibis
url = ibis.literal("https://user:pass@example.com:80/docs/books" )
result = url.userinfo() # user:pass