Important sidenote: Please, take some time to look into How to make good reproducible pandas examples, there are great suggestions there on how you could ask your question better.
Now for your error:
Data must be 1-dimensional
That means pandas
wants a 1-dimensional array, i.e. of the form [0,0,1,1,...,1]. But your preds
array is 2-dimensional, i.e. of the form [[0],[0],[1],[1],...,[1]]
.
So you need to flatten the preds
array here:

Instead of for
-loops consider using list comprehensions to change your code to something like this:
predictions = [1 if p>0.5 else 0 for p in preds]
df = pd.DataFrame({'PassengerId': test['PassengerId'].values,
'Survived': predictions})
Also, in the meantime look into ndarray.round method - maybe it will better fit your use case:
predictions = preds.round()