0

Hi I have to execute below python code in apache nifi and my nifi flow is as below
 my python code is as below (I have ruined it locally it is working fine)

`

import pandas as pd
 cdr = pd.read_csv("cdr.csv")
 labels = pd.read_csv("result.csv")
 cdr.rename(mapper={str(value[0]):n for n,value in labels.to_dict(orient='list').items()},  axis=1, inplace=True)

and my nifi flow :- enter image description here

Here cdr comes from GETSFTP and labels comes from get file processor and here cdr data will come continuously

can anyone help me to write above python code in ExecuteScript processor in nifi

1
  • it will be easier to use ExecuteStreamCommand - it allows to read from STDIN and write to STDOUT. but in this case python must be installed near nifi. if you still want to use ExecuteScript I advice you to start from this article: community.hortonworks.com/articles/75032/… Commented Jun 20, 2019 at 7:37

1 Answer 1

0

The ExecuteScript processor cannot use native Python modules, only Jython code. Try using ExecuteStreamCommand to run arbitrary Python code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.