Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the capitalize () method in Pandas

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to use the capitalize () method in Pandas. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

The first letter of Series.str.capitalize () is capitalized

Import pandas as pds = pd.Series ([Aaba', 'Baca',' CABA', 'dog',' cat']) print (s.str.capitalize ()) print (s.str.lower ()) print (s.str.upper ()) 0A1 B2 C3 Aaba4 Baca5 Caba6 Dog7 Catdtype: object

Series.str.lower () all lowercase

0 a1 b2 c3 aaba4 baca5 caba6 dog7 catdtype: object

Series.str.upper () all uppercase

0 A1 B2 C3 AABA4 BACA5 CABA6 DOG7 CATdtype: object

Series.str.swapcase () reverses case

0a1b2c3 aABA4 bACA5 caba6 DOG7 CATdtype: object on how to use the capitalize () method in Pandas is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report