title: Issue when writing a list into a binary file
body: <p>I am trying to write a <code>list</code> into a binary file and later load it again. I have this code:</p>
  
  <pre><code>with open('W.bin', mode='wb') as file:                                 
      file.write(bytearray(model.estimator.intercepts_))
  file.close()
  </code></pre>
  
  <p>Where <code>model.estimator.intercepts_</code> is a list. However, I get this error:</p>
  
  <pre><code>  File "LM.py", line 200, in model_training
      file.write(bytearray(model.estimator.intercepts_))
  TypeError: an integer or string of size 1 is required
  </code></pre>
  
  <p>I don't know what's wrong with my code? Thank you</p>