Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
_tarray.pyzdoc
Go to the documentation of this file.
1\pythondoc TArray
2
3When used from Python, the subclasses of TArray (TArrayC, TArrayS, TArrayI, TArrayL, TArrayF and TArrayD) benefit from the following extra features:
4
5- Their size can be obtained with `len`, which is equivalent to TArray::GetSize():
6\code{.py}
7import ROOT
8
9a = ROOT.TArrayD(2)
10print(len(a)) # prints '2'
11\endcode
12
13- Their elements can be read and written with the `getitem` and `setitem` operators, respectively:
14\code{.py}
15a[0] = 0.2
16a[1] = 1.7
17print(a[0]) # prints '0.2'
18\endcode
19
20- They are iterable:
21\code{.py}
22for elem in a:
23 print(elem)
24\endcode
25
26\endpythondoc
#define a(i)
Definition RSha256.hxx:99
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Array of chars or bytes (8 bits per element).
Definition TArrayC.h:27
Array of doubles (64 bits per element).
Definition TArrayD.h:27
Array of floats (32 bits per element).
Definition TArrayF.h:27
Array of integers (32 bits per element).
Definition TArrayI.h:27
Array of longs (32 or 64 bits per element).
Definition TArrayL.h:27
Array of shorts (16 bits per element).
Definition TArrayS.h:27
Abstract array base class.
Definition TArray.h:31
Int_t GetSize() const
Definition TArray.h:47
for(Int_t i=0;i< n;i++)
Definition legend1.C:18