
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
pandasでカラムが特定の文字列を含むか1行ずつチェックし、その行のみを抽出 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
pandasでカラムが特定の文字列を含むか1行ずつチェックし、その行のみを抽出 - Qiita
import pandas df = pandas.read_csv('sample.csv') df2 = pandas.DataFrame({}) for index, row in df.... import pandas df = pandas.read_csv('sample.csv') df2 = pandas.DataFrame({}) for index, row in df.iterrows(): if row['x'] in ("b", "e"): # check df2 = df2.append({'x': row['x'], 'y': row['y'], 'z': row['z']}, ignore_index=True) print(df2)