SHARE
TWEET

Untitled

a guest Jun 17th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import matplotlib.pyplot as mpl
  3.  
  4. im0 = np.genfromtxt('X.csv', delimiter=",")
  5. im = (im0*255).astype('uint8')
  6. im2 = np.zeros([100, 100, 3], dtype=np.uint8)
  7.  
  8. for i in range(len(im0)):
  9.      for j in range(len(im0)):
  10.          im2[i][j][0] = im0[i][3*j]
  11.          im2[i][j][1] = im0[i][3*j +1]
  12.          im2[i][j][2] = im0[i][3*j +2]
  13.              
  14. mpl.imsave('X.png',im2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top