LoginSignup
2
2

More than 5 years have passed since last update.

Pandas データフレーム 文字列操作

Posted at

Pandas データフレームの列操作の学習しても、頭が整理されなかった。
その理由は「列や行の選択の仕方が複数あること」だと思っていたが、違うことに気づいた。
理由は以下の2つの違いをきっちり意識できていなかったことだった。
忘れないうちにメモ。

pandasの文字列操作には2つの方法がある。
1、Iteration(for loopなど)を利用して、一つ一つの要素(エクセルで言う所の「セル」)にアクセスして操作を行う。
2、列自体が持つメソッド(正確にはSeriesまたはDataframeが持つメソッド)利用する。

参考リンクは以下。(2に関してのみ)
https://note.nkmk.me/python-pandas-str-replace-strip-etc/

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2