<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>momijiame</author_name>
  <author_url>https://blog.hatena.ne.jp/momijiame/</author_url>
  <blog_title>CUBE SUGAR CONTAINER</blog_title>
  <blog_url>https://blog.amedama.jp/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>pandas</anon>
    <anon>機械学習</anon>
    <anon>統計</anon>
  </categories>
  <description>取り扱うデータをサンプリングする機会は意外と多い。 ユースケースとしては、例えばデータが多すぎて扱いにくい場合や、グループごとに件数の偏りのある場合が挙げられる。 今回は pandas を使ってグループごとに特定の件数をサンプリングする方法について書いてみる。 使った環境は次の通り。 $ sw_vers ProductName: Mac OS X ProductVersion: 10.14.3 BuildVersion: 18D109 $ python -V Python 3.7.2 $ pip list | grep pandas pandas 0.24.2 下準備 まずは pandas を…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.amedama.jp%2Fentry%2Fpandas-group-sampling&quot; title=&quot;Python: pandas でグループごとにデータをサンプリングする - CUBE SUGAR CONTAINER&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://images-fe.ssl-images-amazon.com/images/I/415QwBMiAcL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-03-16 20:17:50</published>
  <title>Python: pandas でグループごとにデータをサンプリングする</title>
  <type>rich</type>
  <url>https://blog.amedama.jp/entry/pandas-group-sampling</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
