I passed all 9 questions except the last 10: as the weights formula is incorrect:

Q10: FAIL

The value of ‘weights’ was incorrect

NotebookRuntimeError : object of type ‘int’ has no len()

how should I defined the weight, any help

I try to do it like this :

weights = model.coef_

weights

weights_df = pd.DataFrame({

‘columns’: train_inputs.columns,

‘weight’: weights

}).sort_values(‘weight’, ascending=False)

is it correct?