見出し画像

【Python】大文字小文字変換のエラーの対処例

A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

応急処置(処理速度が遅いけれど)

for index,row in df.iterrows():
  df['h'].loc[index] = row[0].lower()
  df['content'].loc[index] = row[1].lower()

いつもお読みいただき、ありがとうございます。 書くだけでなく読みたいので、コメント欄で記事名入れてもらうと見に行きます。