'Manipulating dataframe columns
I have a pandas dataframe that I want to manipulate. Here's an example of the data:
As you can see we have 3 columns. Column proteins has multiple elements separated with a comma, whereas column term description only has a single element per row. My aim is to reverse this and have a column with single elements from proteins and another column with multiple elements from term description. To explain this by an example if proteins CYP51A1 fall under the term description metabolic process and organic substance metabolic process I want my dataframe to look like this:
protein_name | term description
---------------------------------------------------------------------
CYP51A1 | metabolic process, organic substance metabolic process
etc.
i hope i explained this good enough! thanks for your help!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

