str.replace function raise erorr that an integer is required
<p>I wanna ask the problem I encountered. At first, 
Let me show you my whole code</p>

<pre><code>df1 = pd.read_excel(r'E:\ë´ë¼ë¬¸ìë£\ê³¨ëª©ìê¶ ë°ì´í°\ì´íìë¡ 54ê¸¸ ë´ì©ëºê±°.xlsx' , sheetname='first_day_datas')
df1.registerdate= df1.registerdate.astype(str) # ì¹¼ë¼ ìì± ë°ê¾¸ê¸°
df2 = pd.to_datetime(df1['registerdate'].str[0:10])
df3 = df2['registerdate'].str.replace('-', '').str.strip()
</code></pre>

<p>I just wanna change the string in registerdate column.
when I put print(df2.head(3)). It shows like below</p>

<pre><code>0   2016-10-11
1   2016-10-15
2   2016-10-15
</code></pre>

<p>so I wanna replace '-' with ''. 
I type the code and 'TypeError: an integer is required' popped out.
How can I solve this problem??</p>

<p>It seems df2 has no column 'registerdate', It is a timestamp list.
I think <code>df2.map(lambda x: x.strftime('%Y%m%d')</code> can convert timestamp to the format you need.</p>

python pandas