<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>aroma_black</author_name>
  <author_url>https://blog.hatena.ne.jp/aroma_black/</author_url>
  <blog_title>logging.info(self)</blog_title>
  <blog_url>https://aroma-black.hatenadiary.org/</blog_url>
  <categories>
    <anon>pyhton</anon>
    <anon>ruby</anon>
  </categories>
  <description>動機 設定値の重複を削るためににスクリプトを組んだのだけど、Pythonだとループで回して新しい配列に突っ込んでとかやらないといけないっぽいので面倒臭いエレガントじゃない。一応Pythonで単純に書くと以下のようなコードになると思います。 a = [1,3,4,2,3,5] b = [] for v in a: if v not in b: b.append(v) print b # [1, 3, 4, 2, 5] RubyはArray.uniqを作った そんなこんなでRubyだとuniqという重複を取り除くメソッドがあるのでこちらを使って処理しました。 コードは [1,3,4,2,3,5].…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faroma-black.hatenadiary.org%2Fentry%2F20110203%2F1296746826&quot; title=&quot;Pythonのリスト内包表記でRubyのuniqメソッドと同じ事をする - logging.info(self)&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-02-03 00:27:06</published>
  <title>Pythonのリスト内包表記でRubyのuniqメソッドと同じ事をする</title>
  <type>rich</type>
  <url>https://aroma-black.hatenadiary.org/entry/20110203/1296746826</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
