title: Shuffle all rows of a csv file with Python
body: <p>I have an input csv file with data:</p>
  
  <pre><code>a   15
  b   14
  c   20
  d   45
  </code></pre>
  
  <p>I want to generate a different csv file which will contain complete data rows from input file but rows should be shuffled.</p>
  
  <p>like output file may contain values-</p>
  
  <pre><code>b 14
  a 15
  c 20
  d 45 
  </code></pre>
  
  <p>I have tried this code:</p>
  
  <pre><code>import random
  import sys
  op=open('random.csv','w+')
  ip=open(sys.argv[1],'r')
  data=ip.read()
  data1=str(random.choices(data))
  op.write(data1)
  op.close()
  </code></pre>