函数原型为:numpy.ma.frombuffer(buffer, dtype=float, count=-1, offset=0)
import numpy
s = 'hello world'
print numpy.frombuffer(s, dtype='S1', count=3, offset=0)