<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pivot on 每日拍拍</title>
    <link>https://dailypypy.org/tags/pivot/</link>
    <description>Recent content in Pivot on 每日拍拍</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-tw</language>
    <copyright>© 2026 每日拍拍</copyright>
    <lastBuildDate>Thu, 05 Nov 2026 10:20:00 +0800</lastBuildDate><atom:link href="https://dailypypy.org/tags/pivot/index.xml" rel="self" type="application/rss+xml" />
    <follow_challenge>
      <feedId>155076163427069952</feedId>
      <userId>154825760438254592</userId>
    </follow_challenge>
    
    
    <item>
      <title>Polars Pivot / Unpivot：長寬表轉換、重複鍵與 Round-trip 契約</title>
      <link>https://dailypypy.org/learn/polars-pivot-unpivot-contracts/</link>
      <pubDate>Thu, 05 Nov 2026 10:20:00 +0800</pubDate>
      
      <guid>https://dailypypy.org/learn/polars-pivot-unpivot-contracts/</guid>
      <description>&lt;!---
1440x768
prompt: masterpiece, best quality, highres, clean anime illustration, japanese anime style, soft shading, flat color design, 1girl, black hair, green eyes, white off-shoulder shirt, black short skirt, high-angle full body view, sitting sideways on a simple stool with both hands resting naturally on her lap, bright cheerful laugh with open eyes, looking at viewer, pastel powder blue background, neat composition, detailed eyes, cute and smart vibe, minimal background, polished illustration, no text
negative prompt: worst quality, bad eye, bad hand, extra limbs, manga, multiple views, monochrome, text, signature
dedup note: Specific reshaping follow-up to ../python-polars/. Unlike ../pandas-groupby-pivot-report/, this is not a sales aggregation report: no sum/first conflict resolution. Owns reversible homogeneous measurement matrices, duplicate cell rejection, null-versus-absent preservation via paired presence matrix, deterministic schema/order and bidirectional round-trip tests. Join cardinality and nested expansion remain in their existing dedicated articles. 212 current source inventories and weekly-plan history checked before drafting.
source check: Official eager/lazy pivot and unpivot references reviewed 2026-11-05. Examples pinned to Python 3.12 / Polars 2.0.0; application admission rules below are deliberately narrower than Polars itself.
verification: All 8 Python blocks parsed; sequential demo and 23 pytest cases passed, including sparse/full round-trips, duplicate admission, schema drift, all-null/missing metrics, corrupt masks and eager/lazy equality. Current-source prose character 5-gram Jaccard maximum 0.050979 against Join contracts; manual scope review passed. ComfyUI output DAILYPYPY_00157_.png verified as 1440x768 PNG and visually inspected for text, face, hands and artifacts.
publication note: Required random display date is retained; publishDate enables the authorized morning release with buildFuture=false.
---&gt;

&lt;h2 class=&#34;relative group&#34;&gt;一. 前言：轉回去了，真的等於沒改過嗎？ 
    &lt;div id=&#34;一-前言轉回去了真的等於沒改過嗎&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
    
    &lt;span
        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
        &lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
            style=&#34;text-decoration-line: none !important;&#34; href=&#34;#%e4%b8%80-%e5%89%8d%e8%a8%80%e8%bd%89%e5%9b%9e%e5%8e%bb%e4%ba%86%e7%9c%9f%e7%9a%84%e7%ad%89%e6%96%bc%e6%b2%92%e6%94%b9%e9%81%8e%e5%97%8e&#34; aria-label=&#34;定位點&#34;&gt;#&lt;/a&gt;
    &lt;/span&gt;        
    
&lt;/h2&gt;
&lt;p&gt;嗨，我是拍拍君。今天拿到一份量測表：每列是一個樣本，兩個指標各占一欄。
畫圖想用長表，交接又要寬表，於是 &lt;code&gt;unpivot()&lt;/code&gt;、&lt;code&gt;pivot()&lt;/code&gt; 各跑一次。
欄位回來了，大家就放心收工？先等等。&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://dailypypy.org/learn/polars-pivot-unpivot-contracts/featured.png" />
    </item>
    
  </channel>
</rss>
