<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tiginkgo</author_name>
  <author_url>https://blog.hatena.ne.jp/tiginkgo/</author_url>
  <blog_title>初心者のためのpython入門</blog_title>
  <blog_url>https://tiginkgo.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>前書き 前回に続き、collectionsライブラリについて紹介します。 Counter Counterは、リストやタプルなどのハッシュ可能なオブジェクトから値の出現回数を数え上げることができる辞書のサブクラスです。 from collections import Counter l = [1 if i % 2 else 0 for i in range(10)] # リスト内包表記 c = Counter(l) print(c) print(c[0]) Counter({0: 5, 1: 5}) # print(c) 5 # print(c[0]) 便利なメソッドとして以下のものがあります。…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftiginkgo.hateblo.jp%2Fentry%2F20190714%2F1563086052&quot; title=&quot;collections[2] - 初心者のためのpython入門&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://thumbnail.image.rakuten.co.jp/@0_mall/book/cabinet/7386/9784873117386.jpg?_ex=128x128</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-07-14 15:34:12</published>
  <title>collections[2]</title>
  <type>rich</type>
  <url>https://tiginkgo.hateblo.jp/entry/20190714/1563086052</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
