* @param s String from which to create the array
     * @param type Datatype of the array
     * @return The new multiarray
     */
    public static PyMultiarray fromString(final String s, final char type) {
        final int itemsize = PyMultiarray.typeToNBytes(type)
                * PyMultiarray.typeToNElements(type);
        if (s.length() % itemsize != 0) { throw Py
                .ValueError("string size must be a multiple of element size"); }
        Object data;
        try {
            data = PyMultiarray.fromByteArray(s.getBytes("ISO-8859-1"), type);
        } catch (final UnsupportedEncodingException e) {
            throw Py.RuntimeError("ISO-LATIN-1 encoding unavailable, can't convert from string.");
        }
        return new PyMultiarray(data, type, 0,
                new int[] { Array.getLength(data)
                        / PyMultiarray.typeToNElements(type) },
                new int[] { PyMultiarray.typeToNElements(type) });
    }