2016-08-25 129 views

回答

10

您可以使用str.title

print (df.Column1.str.title()) 
0 The Apple 
1  The Pear 
2 Green Tea 
Name: Column1, dtype: object 

另一个非常类似的方法是str.capitalize,但它转换为大写只有第一个字母:

print (df.Column1.str.capitalize()) 
0 The apple 
1  The pear 
2 Green tea 
Name: Column1, dtype: object 
+0

@jezrael谢谢!奇迹般有效! –

+0

@JasonChingYuk - 很高兴能帮到你! – jezrael

相关问题