def snp_query(G, bim, Isnp):
bim_out = bim[Isnp].reset_index(drop=True)<EOL>G_out = G[bim_out.i.values]<EOL>bim_out.i = pd.Series(sp.arange(bim_out.shape[<NUM_LIT:0>]), index=bim_out.index)<EOL>return G_out, bim_out<EOL>
r"""
    Parameters
    ----------
    G : (`n_snps`, `n_inds`) array
        Genetic data
    bim : pandas.DataFrame
        Variant annotation
    Isnp : bool array
        Variant filter

    Returns
    -------
    G_out : (`n_snps`, `n_inds`) array
        filtered genetic data
    bim_out : dataframe
        filtered variant annotation