<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kaeken</author_name>
  <author_url>https://blog.hatena.ne.jp/kaeken/</author_url>
  <blog_title>kaeken(嘉永島健司)ブログ</blog_title>
  <blog_url>https://kaeken.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>Pandas</anon>
  </categories>
  <description>Python/pandasを使って、以下のようにグルーピングした複数行を一行にする方法について解説します。 before col1 col2 0 1 hoge 1 2 fuga 2 3 piyo 3 1 foo 4 2 bar 5 3 baz after：col1でグルーピングした上で、col2を一行に集約 col1 1 hoge,foo 2 fuga,bar 3 piyo,baz まず、以下のようなデータフレームを準備します。 import pandas as pd df = pd.DataFrame( {&quot;col1&quot;:[1,2,3,1,2,3], &quot;col2&quot;:[&quot;hoge&quot;,&quot;fuga&quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkaeken.hatenablog.com%2Fentry%2F2017%2F12%2F08%2F080000&quot; title=&quot;Python/pandasでグルーピングした複数行をカンマ区切りの一行にする方法 - kaeken(嘉永島健司)ブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/k/kaeken/20180131/20180131225205.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-02-01 08:00:00</published>
  <title>Python/pandasでグルーピングした複数行をカンマ区切りの一行にする方法</title>
  <type>rich</type>
  <url>https://kaeken.hatenablog.com/entry/2017/12/08/080000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
