User Tools

Site Tools


eman2:numpy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

eman2:numpy [2025/06/19 17:39] – created steveludtkeeman2:numpy [2025/06/19 17:43] (current) steveludtke
Line 11: Line 11:
  
 npd*=2    # This will modify the values in BOTH the EMData object and the NumPy object! npd*=2    # This will modify the values in BOTH the EMData object and the NumPy object!
 +print(emd["mean"],npd.mean())
  
  
- +npd2=np.zeros((128,128)) 
-npd2=np.zeroes((128,128)) +emd2=from_numpy(npd2)      # data is copied to make a new EMData object
-emd2=from_numpy(npd2)     # data is copied to make a new EMData object+
  
 npd2+=1   # Modifies the NumPy array, NOT the EMData object npd2+=1   # Modifies the NumPy array, NOT the EMData object
 +print(emd2["mean"],npd2.mean())
  
 </code> </code>
  
eman2/numpy.1750354758.txt.gz · Last modified: by steveludtke