File: case.rst

package info (click to toggle)
pandas 2.3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 66,808 kB
  • sloc: python: 424,977; ansic: 9,190; sh: 264; xml: 102; makefile: 85
file content (10 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
The equivalent pandas methods are :meth:`Series.str.upper`, :meth:`Series.str.lower`, and
:meth:`Series.str.title`.

.. ipython:: python

   firstlast = pd.DataFrame({"string": ["John Smith", "Jane Cook"]})
   firstlast["upper"] = firstlast["string"].str.upper()
   firstlast["lower"] = firstlast["string"].str.lower()
   firstlast["title"] = firstlast["string"].str.title()
   firstlast