def pre_cross_qlist(data, code):
    '自适应给出可以进行交叉分析的变量和相应选项\n    满足以下条件的将一键交叉分析：\n    1、单选题\n    2、如果选项是文本，则平均长度应小于10\n    ...\n    返回：\n    cross_qlist: [[题目序号,变量选项],]\n    '
    cross_qlist = []
    for qq in code:
        qtype = code[qq]['qtype']
        qlist = code[qq]['qlist']
        content = code[qq]['content']
        sample_len_qq = data[code[qq]['qlist']].notnull().T.any().sum()
        if (qtype not in ['单选题']):
            continue
        if (not (set(qlist) <= set(data.columns))):
            continue
        t = qtable(data, code, qq)['fo']
        if ('code_order' in code[qq]):
            code_order = code[qq]['code_order']
            code_order = [q for q in code_order if (q in t.index)]
            t = pd.DataFrame(t, index=code_order)
        items = list(t.index)
        code_values = list(code[qq]['code'].values())
        if (len(items) <= 1):
            continue
        if all([isinstance(t, str) for t in code_values]):
            if ((sum([len(t) for t in code_values]) / len(code_values)) > 15):
                continue
        if (('code_order' in code[qq]) and (len(items) < 10)):
            code_order = [q for q in code[qq]['code_order'] if (q in t.index)]
            t = pd.DataFrame(t, index=code_order)
            ind = np.where((t['频数'] >= 10))[0]
            if (len(ind) > 0):
                cross_order = list(t.index[range(ind[0], (ind[(- 1)] + 1))])
                cross_qlist.append([qq, cross_order])
            continue
        if re.findall('性别|年龄|gender|age', content.lower()):
            cross_qlist.append([qq, items])
            continue
        if ((len(items) <= (sample_len_qq / 30)) and (len(items) < 10)):
            cross_order = list(t.index[(t['频数'] >= 10)])
            if cross_order:
                cross_qlist.append([qq, cross_order])
            continue
    return cross_qlist
自适应给出可以进行交叉分析的变量和相应选项
满足以下条件的将一键交叉分析：
1、单选题
2、如果选项是文本，则平均长度应小于10
...
返回：
cross_qlist: [[题目序号,变量选项],]
def pre_cross_qlist(data, code):
    '自适应给出可以进行交叉分析的变量和相应选项\n    满足以下条件的将一键交叉分析：\n    1、单选题\n    2、如果选项是文本，则平均长度应小于10\n    ...\n    返回：\n    cross_qlist: [[题目序号,变量选项],]\n    '
    cross_qlist = []
    for qq in code:
        qtype = code[qq]['qtype']
        qlist = code[qq]['qlist']
        content = code[qq]['content']
        sample_len_qq = data[code[qq]['qlist']].notnull().T.any().sum()
        if (qtype not in ['单选题']):
            continue
        if (not (set(qlist) <= set(data.columns))):
            continue
        t = qtable(data, code, qq)['fo']
        if ('code_order' in code[qq]):
            code_order = code[qq]['code_order']
            code_order = [q for q in code_order if (q in t.index)]
            t = pd.DataFrame(t, index=code_order)
        items = list(t.index)
        code_values = list(code[qq]['code'].values())
        if (len(items) <= 1):
            continue
        if all([isinstance(t, str) for t in code_values]):
            if ((sum([len(t) for t in code_values]) / len(code_values)) > 15):
                continue
        if (('code_order' in code[qq]) and (len(items) < 10)):
            code_order = [q for q in code[qq]['code_order'] if (q in t.index)]
            t = pd.DataFrame(t, index=code_order)
            ind = np.where((t['频数'] >= 10))[0]
            if (len(ind) > 0):
                cross_order = list(t.index[range(ind[0], (ind[(- 1)] + 1))])
                cross_qlist.append([qq, cross_order])
            continue
        if re.findall('性别|年龄|gender|age', content.lower()):
            cross_qlist.append([qq, items])
            continue
        if ((len(items) <= (sample_len_qq / 30)) and (len(items) < 10)):
            cross_order = list(t.index[(t['频数'] >= 10)])
            if cross_order:
                cross_qlist.append([qq, cross_order])
            continue
    return cross_qlist