title: How to convert a pandas dataframe to a bytes string?
body: <p>I have a pandas dataframe as following named as df</p>
  <p><a href="https://i.stack.imgur.com/m4Ebx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m4Ebx.png" alt="enter image description here" /></a></p>
  <p>I want to convert this dataframe to a bytes string which is having type <strong>bytes</strong> i.e when I enter <code>type(df)</code> it should give me an output of <code>Bytes</code> instead of <code>pandas.core.frame.DataFrame</code> The output should look like following:</p>
  <pre><code>b'Age,Height,Weight,City\r\n23,5.45,67,New York\r\n'
  </code></pre>