OneHotEncoder input not working as an array
It is pretty clear that what you have is a list and the tutorial is producing an array but can you check what type the values in your list are and it would help to know what these variables hold: review_df.review_type
I am currently following a tutorial for my project when it starts using the OneHotEncoder. When he inputs the following code:
type_one_hot = OneHotEncoder(sparse=False).fit_transform(
review_df.review_type.to_numpy().reshape(-1, 1))
print(type_one_hot[0])
he gets an output of:
array([0., 1.])
whereas when I run the code I just get:
[0. 1.]
This matters for later on as when I later input using this style it complains that my input is not a vector. Any ideas?