Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from sdc_etl_libs.sdc_dataframe.udfs.pandas.PandasUDF import PandasUDF 

2 

3 

4class ConcatColumnsPandasUDF(PandasUDF): 

5 

6 @staticmethod 

7 def apply_udf(row_, **opts_): 

8 """ Returns a string with the concatenation of the columns requested. 

9 param: row_ of a dataframe 

10 type: row_: Pandas Series() 

11 param: opts_: contains "list_columns" and "separator". 

12 type: opts: dict 

13 - "list_columns" example: "list_columns": ["DATE", "TIME"] 

14 - "separator" example: "separator":" " 

15 return: str 

16 """ 

17 return opts_["separator"].join(str(row_[column]) for column in opts_["list_columns"])