<?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>~（チルダ）は、NOT演算子として使います。本記事では、pandasにて次の２つの使用例を示します。 使用例1：指定した列に対して、指定した要素以外の行データを抽出する使用例2：df.duplicated()と組み合わせることで、重複要素がある行データを除外する ■使用例1：指定列に対して、指定した要素以外の行データを抽出する import pandas as pd df = pd.DataFrame({&quot;A&quot;: [10, 20, 30, 40], &quot;B&quot;: [&quot;X&quot;, &quot;Y&quot;, &quot;X&quot;, &quot;Z&quot;]}) print(df) まず、上記のpandasデータフレームは次の通りです。 # &quot;X&quot; で…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhk29.hatenablog.jp%2Fentry%2F2025%2F01%2F31%2F233414&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/20250131/20250131233054.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-01-31 23:34:14</published>
  <title>Python pandasにおける~（チルダ）の使用例</title>
  <type>rich</type>
  <url>https://hk29.hatenablog.jp/entry/2025/01/31/233414</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
