Hi,
I'm using KNIME v2.11.3. I am unable to get the panda append method to work in the KNIME Labs Python script node. I get no errors, but when I print the contents of the output dataframe, it is empty indicating that the append method didn't work.
Here is a "cleansed" snippet of my code to illustrate. The format of the input_table is the same as the output_table that I have defined, minus the 'CDS_FIELD_ID' column. (I am a novice python scripter, so please be easy on me ) :-)
import re import pandas as pd output_table = pd.DataFrame(columns=('ID','username','CREATED','MODIFIED','CONTENT','TYPE','NAME','CDS_FIELD_ID')) cds_ids = pd.DataFrame(columns=('ID','CDS_FIELD_ID')) for theID, username,theCreated,theModified,theContent,theType,theName in zip(input_table['ID'],input_table['USER521'],input_table['CREATED'],input_table['MODIFIED'],input_table['CONTENT'],input_table['TYPE'],input_table['NAME']): idSeries = re.findall(r'FACT\/([0-9]*)',theContent) print idSeries for theCDS in enumerate(idSeries): print theID,username,theCreated,theModified,theContent,theType,theName,theCDS[1] thisRow = pd.DataFrame([theID,username,theCreated,theModified,theType,theName,theCDS[1]]) output_table.append(thisRow) print output_table
Thanks,
Mark