MCPcopy
hub / github.com/pandas-dev/pandas / _set_name

Method _set_name

pandas/core/series.py:1910–1923  ·  view source on GitHub ↗

Set the Series name. Parameters ---------- name : str inplace : bool Whether to modify `self` directly or return a copy.

(self, name, inplace: bool = False)

Source from the content-addressed store, hash-verified

1908 return ser
1909
1910 def _set_name(self, name, inplace: bool = False) -> Series:
1911 """
1912 Set the Series name.
1913
1914 Parameters
1915 ----------
1916 name : str
1917 inplace : bool
1918 Whether to modify `self` directly or return a copy.
1919 """
1920 inplace = validate_bool_kwarg(inplace, "inplace")
1921 ser = self if inplace else self.copy(deep=False)
1922 ser.name = name
1923 return ser
1924
1925 @Appender(
1926 dedent(

Callers 2

renameMethod · 0.95
test_set_nameMethod · 0.95

Calls 2

validate_bool_kwargFunction · 0.90
copyMethod · 0.45

Tested by 1

test_set_nameMethod · 0.76