Convert strings in the Series/Index to lowercase. Equivalent to :meth:`str.lower`. Returns ------- Series or Index of objects A Series or Index where the strings are modified by :meth:`str.lower`. See Also -------- Serie
(self)
| 3848 | |
| 3849 | @forbid_nonstring_types(["bytes"]) |
| 3850 | def lower(self): |
| 3851 | """ |
| 3852 | Convert strings in the Series/Index to lowercase. |
| 3853 | |
| 3854 | Equivalent to :meth:`str.lower`. |
| 3855 | |
| 3856 | Returns |
| 3857 | ------- |
| 3858 | Series or Index of objects |
| 3859 | A Series or Index where the strings are modified by :meth:`str.lower`. |
| 3860 | |
| 3861 | See Also |
| 3862 | -------- |
| 3863 | Series.str.lower : Converts all characters to lowercase. |
| 3864 | Series.str.upper : Converts all characters to uppercase. |
| 3865 | Series.str.title : Converts first character of each word to uppercase and |
| 3866 | remaining to lowercase. |
| 3867 | Series.str.capitalize : Converts first character to uppercase and |
| 3868 | remaining to lowercase. |
| 3869 | Series.str.swapcase : Converts uppercase to lowercase and lowercase to |
| 3870 | uppercase. |
| 3871 | Series.str.casefold: Removes all case distinctions in the string. |
| 3872 | |
| 3873 | Examples |
| 3874 | -------- |
| 3875 | >>> s = pd.Series(["lower", "CAPITALS", "this is a sentence", "SwApCaSe"]) |
| 3876 | >>> s |
| 3877 | 0 lower |
| 3878 | 1 CAPITALS |
| 3879 | 2 this is a sentence |
| 3880 | 3 SwApCaSe |
| 3881 | dtype: str |
| 3882 | |
| 3883 | >>> s.str.lower() |
| 3884 | 0 lower |
| 3885 | 1 capitals |
| 3886 | 2 this is a sentence |
| 3887 | 3 swapcase |
| 3888 | dtype: str |
| 3889 | |
| 3890 | >>> s.str.upper() |
| 3891 | 0 LOWER |
| 3892 | 1 CAPITALS |
| 3893 | 2 THIS IS A SENTENCE |
| 3894 | 3 SWAPCASE |
| 3895 | dtype: str |
| 3896 | |
| 3897 | >>> s.str.title() |
| 3898 | 0 Lower |
| 3899 | 1 Capitals |
| 3900 | 2 This Is A Sentence |
| 3901 | 3 Swapcase |
| 3902 | dtype: str |
| 3903 | |
| 3904 | >>> s.str.capitalize() |
| 3905 | 0 Lower |
| 3906 | 1 Capitals |
| 3907 | 2 This is a sentence |