Σημείωμα
Η πρόσβαση σε αυτήν τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να εισέλθετε ή να αλλάξετε καταλόγους.
Η πρόσβαση σε αυτήν τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να αλλάξετε καταλόγους.
Computes the numeric value of the first character of the string column.
For the corresponding Databricks SQL function, see ascii function.
Syntax
from pyspark.sql import functions as dbf
dbf.ascii(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
target column to work on. |
Returns
pyspark.sql.Column: numeric value.
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame(["Spark", "PySpark", "Pandas API"], "STRING")
df.select("*", dbf.ascii("value")).show()