Pandas 文本数据方法 capitalize( ) lower( ) upper( )
2017-05-08 00:00
357 查看
Series.str.capitalize()首字母大写
Series.str.lower()全部小写
Series.str.upper()全部大写
Series.str.swapcase()大小写反转
import pandas as pd s = pd.Series(['A', 'B', 'C', 'Aaba', 'Baca', 'CABA', 'dog', 'cat']) print(s.str.capitalize()) print(s.str.lower()) print(s.str.upper()) 0 A 1 B 2 C 3 Aaba 4 Baca 5 Caba 6 Dog 7 Cat dtype: object
Series.str.lower()全部小写
0 a 1 b 2 c 3 aaba 4 baca 5 caba 6 dog 7 cat dtype: object
Series.str.upper()全部大写
0 A 1 B 2 C 3 AABA 4 BACA 5 CABA 6 DOG 7 CAT dtype: object
Series.str.swapcase()大小写反转
0 a 1 b 2 c 3 aABA 4 bACA 5 caba 6 DOG 7 CAT dtype: object
相关文章推荐
- Pandas 文本数据方法 capitalize( ) lower( ) upper( )
- Pandas 文本数据方法 findall( )
- Pandas 文本数据方法 pad( ) center( ) ljust() rjust() zfill()
- Pandas 文本数据方法 find( ) rfind( ) index( ) rindex( )
- Pandas 文本数据方法 partition( )
- Pandas 文本数据方法 slice( )
- Pandas 文本数据方法 get_dummies()
- JS中的字符串是对象,包含许多与字符串数据交互的方法(lengh,charAt(),toUpperCase(),toLowerCase())
- Pandas 文本数据方法 get_dummies()
- Pandas 文本数据方法 findall( )
- Pandas 文本数据方法 replace( )
- Pandas 文本数据方法 strip( ) lstrip( ) rstrip( )
- Pandas 文本数据方法 slice( )
- Pandas 文本数据方法 extract( ) extractall( )
- Pandas 文本数据方法 extract( ) extractall( )
- Pandas 文本数据方法 repeat( )
- Pandas 文本数据方法 get( )
- Pandas 文本数据方法 wrap( )
- Pandas 文本数据方法 startswith( ) endwith( )
- Pandas 文本数据方法 cat()