Getting Unique Values Across Multiple Columns in a Pandas Dataframe

John Carr
1 min readFeb 8, 2017

--

During the course of a project that I have been working on, I needed to get the unique values from two different columns — I needed all values, and a value in one column was not necessarily in the other. I came across the .ravel function in Pandas. This function flatten the data across all columns, and then allows you to manipulate it as necessary. In my case, returning unique values across both columns.

--

--