前提・実現したいこと
データ加工をしています。
今
2019-08-13T22:30:48+09:00
こんな感じになっている日付を
2019-08-13 という形式に統一したいと思っています。
発生している問題・エラーメッセージ
AttributeError Traceback (most recent call last) <ipython-input-14-d9da2a121d7c> in <module> 1 #action_timeを変換 2 data['action-time'] = pd.to_datetime(data['action_time'], format='%Y-%m-%d') ----> 3 data['join-date'] = data['action-time'].strftime('%Y-%m-%d') 4 data.info() c:\users\jupyter-notebook\lib\site-packages\pandas\core\generic.py in __getattr__(self, name) 5178 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5179 return self[name] -> 5180 return object.__getattribute__(self, name) 5181 5182 def __setattr__(self, name, value): AttributeError: 'Series' object has no attribute 'strftime'
該当のソースコード
Python
1data['action-time'] = pd.to_datetime(data['action_time'], format='%Y-%m-%d') 2data['join-date'] = data['action-time'].strftime('%Y-%m-%d')
試したこと
ネットで調べているとstrftimeやstrptimeを使うようですが、
元データの形式が違うため、
あまり参考になるものがありません。
何卒宜しくお願い致します。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/20 03:14
2019/08/20 03:45