def map_java_datatypes(df):  # pylint: disable=C0103
    """Maps Python dtypes for all columns in datafrae to Java types."""
    colnames = df.columns.tolist()  # assumes string header
    datatype_map = {
        'u': 'int',
        'i': 'int',
        'b': 'boolean',
        'f': 'double',
        'O': 'String'}
    datatypes = [datatype_map[d.kind] for d in df.dtypes.tolist()]
    return [colnames, datatypes]