Question

IQBOT Table Data Extraction

  • 22 March 2023
  • 3 replies
  • 68 views

Badge +1

Folks

Have a scenario, trying to cleanse the table data in iqbot for the below scenario can anyone help me with the python code.

Table Data will have space followed by any special character, wherein we need to remove the space.

Ex:

Input : ( USA )

Output : (USA)

Friendly Note: Have already gone through all the forms and no getting right solution for this


3 replies

Userlevel 4
Badge +10

Folks

Have a scenario, trying to cleanse the table data in iqbot for the below scenario can anyone help me with the python code.

Table Data will have space followed by any special character, wherein we need to remove the space.

Ex:

Input : ( USA )

Output : (USA)

Friendly Note: Have already gone through all the forms and no getting right solution for this

Hi @DavidQ ,

  • Inside custom scripts for IQ Bot you can use the replace function after converting the data frame. You can use the replace for space to nothing. Might help.

Let me know whether the solution works or not.

Badge +1

Folks

Have a scenario, trying to cleanse the table data in iqbot for the below scenario can anyone help me with the python code.

Table Data will have space followed by any special character, wherein we need to remove the space.

Ex:

Input : ( USA )

Output : (USA)

Friendly Note: Have already gone through all the forms and no getting right solution for this

Hi @DavidQ ,

  • Inside custom scripts for IQ Bot you can use the replace function after converting the data frame. You can use the replace for space to nothing. Might help.

Let me know whether the solution works or not.

Hi Can you share the code?

Userlevel 4
Badge +10

Folks

Have a scenario, trying to cleanse the table data in iqbot for the below scenario can anyone help me with the python code.

Table Data will have space followed by any special character, wherein we need to remove the space.

Ex:

Input : ( USA )

Output : (USA)

Friendly Note: Have already gone through all the forms and no getting right solution for this

Hi @DavidQ ,

  • Inside custom scripts for IQ Bot you can use the replace function after converting the data frame. You can use the replace for space to nothing. Might help.

Let me know whether the solution works or not.

Hi Can you share the code?

Hey @DavidQ ,

  • import pandas as pd
  • df = pd.DataFrame.from_dict(table_values)
  • df['column_name'] = df['Column_name'].replace(" ", "")
  • table_values = df.to_dict()

Please test above code.

Reply