I have this column in our DataFrame that is separated by ';'. I managed to separate them but I was wondering if there was a way to put specific values into one column. For example, I would like to put Wayne State in one column, Oakland University in one column, etc. If this question has been answered already or if there is a similar post/question, please provide the link. I have looked and so far, I have not come across with the same problem.
Asked
Active
Viewed 24 times
0
-
Please [provide a reproducible copy of the DataFrame with `df.to_clipboard(sep=',')`](https://stackoverflow.com/questions/52413246/how-to-provide-a-copy-of-your-dataframe-with-to-clipboard). [Stack Overflow Discourages Screenshots](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). It is likely the question will be downvoted. You are discouraging assistance because no one wants to retype your data or code, and screenshots are often illegible. – Trenton McKinney May 12 '20 at 22:16
-
`df.school_applied.str.split(';', expand=True)` – Trenton McKinney May 12 '20 at 22:33
-
Does this answer your question? [How to split a column into two columns?](https://stackoverflow.com/questions/14745022/how-to-split-a-column-into-two-columns) – Trenton McKinney May 12 '20 at 22:34
-
@TrentonMcKinney does df.to_clipboard work on google colab? i tried it and it's giving me an error – dullerthandull May 13 '20 at 00:44
-
Try `df.head(10).to_dict(orient='records')` then paste the output into a code block. – Trenton McKinney May 13 '20 at 00:52