MCPcopy
hub / github.com/pathwaycom/pathway / lower

Method lower

python/pathway/internals/expressions/string.py:33–72  ·  view source on GitHub ↗

Returns a lowercase copy of a string. Returns: Lowercase string Example: >>> import pathway as pw >>> table = pw.debug.table_from_markdown( ... ''' ... | name ... 1 | Alice ... 2 | Bob ... 3 | CA

(self)

Source from the content-addressed store, hash-verified

31 self._expression = expression
32
33 def lower(self) -> expr.ColumnExpression:
34 """Returns a lowercase copy of a string.
35
36 Returns:
37 Lowercase string
38
39 Example:
40
41 >>> import pathway as pw
42 >>> table = pw.debug.table_from_markdown(
43 ... '''
44 ... | name
45 ... 1 | Alice
46 ... 2 | Bob
47 ... 3 | CAROLE
48 ... 4 | david
49 ... '''
50 ... )
51 >>> table += table.select(name_lower=table.name.str.lower())
52 >>> pw.debug.compute_and_print(table, include_id=False)
53 name | name_lower
54 Alice | alice
55 Bob | bob
56 CAROLE | carole
57 david | david
58 """
59
60 return expr.MethodCallExpression(
61 (
62 (
63 dt.STR,
64 dt.STR,
65 lambda x: api.Expression.apply(
66 str.lower, x, dtype=dt.STR.to_engine()
67 ),
68 ),
69 ),
70 "str.lower",
71 self._expression,
72 )
73
74 def upper(self) -> expr.ColumnExpression:
75 """Returns a uppercase copy of a string.

Callers 15

cargo_buildFunction · 0.80
__wrapped__Method · 0.80
factoryFunction · 0.80
_snapshot_accessFunction · 0.80
_persistence_modeFunction · 0.80
nameMethod · 0.80
nameMethod · 0.80
_parse_ssl_modeFunction · 0.80
eval_convertMethod · 0.80
parse_boolMethod · 0.80
generate_docsMethod · 0.80
_request_schemeFunction · 0.80

Calls 2

applyMethod · 0.80
to_engineMethod · 0.45