title: How to apply multiple custom functions on multiple columns in grouped DataFrame in pandas?
body: <p>I have a pandas <code>DataFrame</code> which is grouped by <code>p_id</code>.
  The goal is to get a <code>DataFrame</code> with data shown under 'Output I'm looking for'.
  I've tried a few things, but I am struggling applying two custom aggregated functions:</p>
  <ul>
  <li><code>apply(list)</code> for <code>x_id</code></li>
  <li><code>'||'.join</code> for <code>x_name</code>.</li>
  </ul>
  <p>How can I solve this problem?</p>
  <p><strong>Input</strong></p>
  <pre><code>| p_id | x_id | x_name |
  |------|------|--------|
  | 1    | 4    | Text   |
  | 2    | 4    | Text   |
  | 2    | 5    | Text2  |
  | 2    | 6    | Text3  |
  | 3    | 4    | Text   |
  | 3    | 7    | Text4  |
  </code></pre>
  <p><strong>Output I'm looking for</strong></p>
  <pre><code>| p_id | x_ids   | x_names            |
  |------|---------|--------------------|
  | 1    | [4]     | Text               |
  | 2    | [4,5,6] | Text||Text2||Text3 |
  | 3    | [4,7]   | Text||Text4        |
  </code></pre>