Returns a uppercase copy of a string. Returns: Uppercase string Example: >>> import pathway as pw >>> table = pw.debug.table_from_markdown( ... ''' ... | name ... 1 | Alice ... 2 | Bob ... 3 | CA
(self)
| 72 | ) |
| 73 | |
| 74 | def upper(self) -> expr.ColumnExpression: |
| 75 | """Returns a uppercase copy of a string. |
| 76 | |
| 77 | Returns: |
| 78 | Uppercase string |
| 79 | |
| 80 | Example: |
| 81 | |
| 82 | >>> import pathway as pw |
| 83 | >>> table = pw.debug.table_from_markdown( |
| 84 | ... ''' |
| 85 | ... | name |
| 86 | ... 1 | Alice |
| 87 | ... 2 | Bob |
| 88 | ... 3 | CAROLE |
| 89 | ... 4 | david |
| 90 | ... ''' |
| 91 | ... ) |
| 92 | >>> table += table.select(name_upper=table.name.str.upper()) |
| 93 | >>> pw.debug.compute_and_print(table, include_id=False) |
| 94 | name | name_upper |
| 95 | Alice | ALICE |
| 96 | Bob | BOB |
| 97 | CAROLE | CAROLE |
| 98 | david | DAVID |
| 99 | """ |
| 100 | |
| 101 | return expr.MethodCallExpression( |
| 102 | ( |
| 103 | ( |
| 104 | dt.STR, |
| 105 | dt.STR, |
| 106 | lambda x: api.Expression.apply( |
| 107 | str.upper, x, dtype=dt.STR.to_engine() |
| 108 | ), |
| 109 | ), |
| 110 | ), |
| 111 | "str.upper", |
| 112 | self._expression, |
| 113 | ) |
| 114 | |
| 115 | def reversed(self) -> expr.ColumnExpression: |
| 116 | """Returns a reverse copy of a string. |