def drop_nan_columns(df, thresh=325):
    """Drop columns that are mostly NaNs

    Excel files can only have 256 columns, so you may have to drop a lot in order to get down to this
    """
    if thresh < 1:
        thresh = int(thresh * df)
    return df.dropna(axis=1, thresh=thresh, inplace=False)
Drop columns that are mostly NaNs

    Excel files can only have 256 columns, so you may have to drop a lot in order to get down to this