When use the replace function to replace a numeric column with a string type, PySpark and teradataml work differently: PySpark ignores such replacement, but teradataml raises error.
You should mention the value to replace appropriately based on column type.
PySpark
>>> df.na.replace(23.5, 23.0).show()
+---+-------+---------+--------------------+ | id|int_col|float_col| str_col| +---+-------+---------+--------------------+ | 1| 21| 21.2|Braund, Mr. Owen ...| | 2| 22| 22.6|Cumings, Mrs. Joh...| | 3| 23| 23.0|Palsson, Master. ...| +---+-------+---------+--------------------+
teradatamlspk
As "str" column is also present, it raises error. You should be careful using columns need to replace.
>>> df.na.replace(23.5, 23.0, 'float_col').show()
+--+-------+---------+--------------------+ |id|int_col|float_col| str_col| +--+-------+---------+--------------------+ | 3| 23| 23.0|Palsson, Master. Gos| | 2| 22| 22.6|Cumings, Mrs. John B| | 1| 21| 21.2|Braund, Mr. Owen Har| +--+-------+---------+--------------------+