0

I want to convert transaction amount into words eg $345.67 to Three Hundred forty five point sixty seven in azure data factory.

How can we acheive this.

1 Answer 1

1

Use lambda function with number_to_words from inflect:

df = pd.DataFrame({'col': ['$345.67','$90.56', '$890']})

import inflect
p = inflect.engine()
df['new'] = df['col'].apply(lambda x: p.number_to_words(x, decimal="point"))
print (df)
       col                                           new
0  $345.67  three hundred and forty-five point six seven
1   $90.56                         ninety point five six
2     $890                      eight hundred and ninety
4
  • Thanks Jezrael, but I want to do with Azure Data Factory Feb 16, 2021 at 8:25
  • @SHIVAMYADAV - there is no possible import python lib?
    – jezrael
    Feb 16, 2021 at 8:26
  • to write python code in ADF, we require Custom Activity and that requires Batch Service, VM, Pool. It requires a lot of resource for single requirement. Thatswhy I want to use only ADF or Azure Function to write Python code but not sure how to use Azure Function using Python Feb 16, 2021 at 9:12
  • Data Factory doesn't natively work on the row level data, so you'll need to leverage a different service from within the pipeline. A Data Flow activity is your best option for row-level operations. Feb 18, 2021 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.