I am working on an assignment of bioinfo.
I have converted from SMILES to the fingerprints(fp) for a group of molecules, and the data frame looks like this:
Then save the file to CSV file with to_csv.
Then reading the file with pd.read_csv
, the fingerprint changes into a string and looks like:
I replace the \n with empty space, , but the type is still a string.
I have used various methods:
ast.literal_eval(fp_df['fp'])
, then there is error:ValueError: malformed node or string:
, from the most upvoted answer herelist(fp_df['fp'])
can't change the type of string[n.strip() for n in x]
doesn't work:
And other methods have also been tried.
May I ask for your help on how to deal with it? Thanks in advance.