<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a1026302</author_name>
  <author_url>https://blog.hatena.ne.jp/a1026302/</author_url>
  <blog_title>ものづくりのブログ</blog_title>
  <blog_url>https://a1026302.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>pandas でテーブルを結合した後のレコードのカウント方法を調査してみました。 both コード まとめ right_only コード まとめ right_only コード まとめ both コード import pandas as pd df = pd.DataFrame({ &quot;_merge&quot;: [&quot;both&quot;, &quot;left_only&quot;, &quot;both&quot;, &quot;both&quot;], &quot;XXX_ID&quot;: [1, 2, 1, 3] }) # 重複含む &quot;both&quot; の数 print(int((df[&quot;_merge&quot;] == &quot;both&quot;).sum())) # → 3 # XXX_ID ベースで重複除外し…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa1026302.hatenablog.com%2Fentry%2F2025%2F07%2F11%2F125808&quot; title=&quot;【python】pandas でテーブルを結合した後のレコードのカウント方法を調査 - ものづくりのブログ&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.user.blog.st-hatena.com/default_entry_og_image/157314735/1599576939808917</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-07-11 12:58:08</published>
  <title>【python】pandas でテーブルを結合した後のレコードのカウント方法を調査</title>
  <type>rich</type>
  <url>https://a1026302.hatenablog.com/entry/2025/07/11/125808</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
