def _createFromLocal(self, data, schema):
    '\n        Create an RDD for DataFrame from a list or pandas.DataFrame, returns\n        the RDD and schema.\n        '
    if (not isinstance(data, list)):
        data = list(data)
    if ((schema is None) or isinstance(schema, (list, tuple))):
        struct = self._inferSchemaFromList(data)
        converter = _create_converter(struct)
        data = map(converter, data)
        if isinstance(schema, (list, tuple)):
            for (i, name) in enumerate(schema):
                struct.fields[i].name = name
                struct.names[i] = name
        schema = struct
    elif (not isinstance(schema, StructType)):
        raise TypeError(('schema should be StructType or list or None, but got: %s' % schema))
    data = [schema.toInternal(row) for row in data]
    return (self._sc.parallelize(data), schema)
Create an RDD for DataFrame from a list or pandas.DataFrame, returns
the RDD and schema.
def _createFromLocal(self, data, schema):
    '\n        Create an RDD for DataFrame from a list or pandas.DataFrame, returns\n        the RDD and schema.\n        '
    if (not isinstance(data, list)):
        data = list(data)
    if ((schema is None) or isinstance(schema, (list, tuple))):
        struct = self._inferSchemaFromList(data)
        converter = _create_converter(struct)
        data = map(converter, data)
        if isinstance(schema, (list, tuple)):
            for (i, name) in enumerate(schema):
                struct.fields[i].name = name
                struct.names[i] = name
        schema = struct
    elif (not isinstance(schema, StructType)):
        raise TypeError(('schema should be StructType or list or None, but got: %s' % schema))
    data = [schema.toInternal(row) for row in data]
    return (self._sc.parallelize(data), schema)