<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>HK29</author_name>
  <author_url>https://blog.hatena.ne.jp/HK29/</author_url>
  <blog_title>PythonとVBAで世の中を便利にする</blog_title>
  <blog_url>https://hk29.hatenablog.jp/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>pandas</anon>
    <anon>抽出</anon>
  </categories>
  <description>本記事では、pandasを利用して列データを行方向へ連結する雛形コードを載せました。下図左が元データで、列名indexの値0,1,2を各グループとして、列名data1,data2,data3の値を行方向へ結合します。この時、重複する値がある場合はその行を削除して、ソートします。処理後の結果が下図右です。 ■本プログラム import pandas as pd import numpy as np def main(): df = pd.read_csv(input_file) print(df) df0 = df[~df.duplicated('index')] # 指定した列の重複する行を削…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhk29.hatenablog.jp%2Fentry%2F2021%2F03%2F04%2F005530&quot; title=&quot;Python 列データを行方向へ連結する「Pandas」 - PythonとVBAで世の中を便利にする&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/H/HK29/20210304/20210304003446.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-03-04 00:55:30</published>
  <title>Python 列データを行方向へ連結する「Pandas」</title>
  <type>rich</type>
  <url>https://hk29.hatenablog.jp/entry/2021/03/04/005530</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
