<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>patorash</author_name>
  <author_url>https://blog.hatena.ne.jp/patorash/</author_url>
  <blog_title>patorashのブログ</blog_title>
  <blog_url>https://patorash.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>最近のPRのレビューをしているときに、二次元配列のデータを入れ替える処理をしているところがあったので、レビュー後にチャットで意見交換していたら綺麗な感じにできたのでそれをメモして残しておく。 transposeを使うのがミソなのだけれど、transposeを使うには、配列の要素数を統一しなければならない。そのために、values_atを使う。このvalues_atを使うアイデアはパートナーさんが考えてくれた。 docs.ruby-lang.org docs.ruby-lang.org # 要素数が異なる配列を準備… arr = [['a', 'b'], ['c', 'd', 'e', 'f']…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpatorash.hatenablog.com%2Fentry%2F2021%2F03%2F17%2F163504&quot; title=&quot;Rubyで要素数が異なる二次元配列で行と列を入れ替える - patorashのブログ&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>2021-03-17 16:35:04</published>
  <title>Rubyで要素数が異なる二次元配列で行と列を入れ替える</title>
  <type>rich</type>
  <url>https://patorash.hatenablog.com/entry/2021/03/17/163504</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
