User Tools

Site Tools


root:python

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
root:python [2009/12/08 09:57] viktorhroot:python [2014/02/12 16:17] (current) – [TGraph] nchiap
Line 1: Line 1:
-===== Root and python =====  +====== Root and python ======  
  
-=== TGraph ===+===== TGraph =====
                  
         from ROOT import *         from ROOT import *
-        from array import array+        from numpy import array
         x = [1,2,3,4]  # a list          x = [1,2,3,4]  # a list 
         y = [5,6,7,8]  # a list         y = [5,6,7,8]  # a list
-        graph = TGraph(len(x),array('f',x),array('f',y)) # convert lists to arrays+        graph = TGraph(len(x),array(x,'f'),array(y,'f')) # convert lists to arrays
root/python.txt · Last modified: 2014/02/12 16:17 by nchiap