rootpy/rootpy — pull request #477 by ndawe (2013-10-09 09:51:23+00:00)
Title: [MRG] fix Char.convert

```python
from rootpy.tree import Tree, TreeModel
from rootpy.tree import IntCol, FloatCol, FloatArrayCol, CharCol, CharArrayCol
from rootpy.io import root_open
from random import gauss, choice
from string import letters

f = root_open("test.root", "recreate")

# define the model
class Event(TreeModel):

s = CharCol()
string = CharArrayCol(5)
x = FloatCol()
y = FloatCol()
z = FloatCol()
f = FloatArrayCol(5)
i = IntCol()

tree = Tree("test", model=Event)

# fill the tree
for i in xrange(100):
tree.s = choice(letters)
tree.string = 'abcde'
tree.x = gauss(.5, 1.)
tree.y = gauss(.3, 2.)
tree.z = gauss(13., 42.)
for j in xrange(5):
tree.f[j] = gauss(-2, 5)
tree.i = i
tree.fill()
tree.write()

f.close()
```