etails class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">import pandas as pd

from comchoice.aggregate.__aggregate import __aggregate
from comchoice.aggregate.__default_parameters import transform_kws
from comchoice.aggregate.__set_rank import __set_rank
from comchoice.aggregate.__set_voters import __set_voters
from comchoice.preprocessing.transform import transform


def k_approval(
    df,
    k=1,
    alternative=&#34;alternative&#34;,
    ballot=&#34;ballot&#