<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a1026302</author_name>
  <author_url>https://blog.hatena.ne.jp/a1026302/</author_url>
  <blog_title>ものづくりのブログ</blog_title>
  <blog_url>https://a1026302.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>Python-pandas</anon>
  </categories>
  <description>以下の2つの処理の違いがわからなかったので調べてみました。 その１ df[&quot;hoge&quot;].astype(&quot;str&quot;).str.zfill(12) その２ df[&quot;hoge&quot;].astype(str).str.zfill(12) 処理の比較 その１ astype(&quot;str&quot;) は NumPy の dtype &quot;str&quot;（固定長の文字列型）を指定しており、内部的には np.str_ 型になる。 非推奨ではないが、Pandas では Python の組み込み型を明示的に使うほうが一般的とのこと。 その２ astype(str) は Python の組み込み関数 str を使って変換 Pandas の…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa1026302.hatenablog.com%2Fentry%2F2025%2F07%2F03%2F171801&quot; title=&quot;【Python】astype(&amp;quot;str&amp;quot;)とastype(str)の違いについて考えてみる - ものづくりのブログ&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.user.blog.st-hatena.com/default_entry_og_image/157314735/1599576939808917</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-07-03 17:18:01</published>
  <title>【Python】astype(&quot;str&quot;)とastype(str)の違いについて考えてみる</title>
  <type>rich</type>
  <url>https://a1026302.hatenablog.com/entry/2025/07/03/171801</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
