diff --git a/doc/source/getting_started/comparison/includes/nth_word.rst b/doc/source/getting_started/comparison/includes/nth_word.rst index 7af0285005d5b..20e2ec47a8c9d 100644 --- a/doc/source/getting_started/comparison/includes/nth_word.rst +++ b/doc/source/getting_started/comparison/includes/nth_word.rst @@ -5,5 +5,5 @@ word by index. Note there are more powerful approaches should you need them. firstlast = pd.DataFrame({"String": ["John Smith", "Jane Cook"]}) firstlast["First_Name"] = firstlast["String"].str.split(" ", expand=True)[0] - firstlast["Last_Name"] = firstlast["String"].str.rsplit(" ", expand=True)[0] + firstlast["Last_Name"] = firstlast["String"].str.rsplit(" ", expand=True)[1] firstlast