0

I have an Excel file that contains the following information

enter image description here

and I need to extract that data into a dataframe with unique values from column ID and value 1; so that I will end up with something like this:

enter image description here

I have done the following:

df=pd.read_excel(file)
dfUnique=pd.unique(df[["column ID","value1"]]).values.ravel('K')

but I get the following error:

could not broadcast input array from shape (5,2) into shape (5)

halfer
  • 19,824
  • 17
  • 99
  • 186
Little
  • 3,363
  • 10
  • 45
  • 74

0 Answers0