<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zia_glass</author_name>
  <author_url>https://blog.hatena.ne.jp/zia_glass/</author_url>
  <blog_title>プロメモグラム</blog_title>
  <blog_url>https://progmemo114.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>サイコロのように当確率で目がでるのではなく、おみくじのように出現確率が変化するようなプログラムが必要になったので作成した。 実際にうまく言っているかを確認するため、ヒストグラムを表示させた。 weighted_random関数 入力：Numpyの配列に重み付けをした数値を入れる(合計が1である必要はない) 出力：ランダムな値(0～配列長-1)を返す import numpy as np import matplotlib.pyplot as plt # 入力データ(それぞれ、10%,30%,60%) data = np.array([0.1, 0.3, 0.6]) # 関数 def weigh…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fprogmemo114.hatenablog.com%2Fentry%2F2017%2F11%2F25%2F215103&quot; title=&quot;当確率ではないランダム - プロメモグラム&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/z/zia_glass/20171125/20171125214942.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-11-25 21:51:03</published>
  <title>当確率ではないランダム</title>
  <type>rich</type>
  <url>https://progmemo114.hatenablog.com/entry/2017/11/25/215103</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
