class_docstr: String Methods operating on object-dtype ndarrays.
class_docstr_tok: ["String","Methods","operating","on","object-dtype","ndarrays","."]
code: def _str_pad(
      self,
      width: int,
      side: Literal["left", "right", "both"] = "left",
      fillchar: str = " ",
  ):
      if side == "left":
          f = lambda x: x.rjust(width, fillchar)
      elif side == "right":
          f = lambda x: x.ljust(width, fillchar)
      elif side == "both":
          f = lambda x: x.center(width, fillchar)
      else:  # pragma: no cover
          raise ValueError("Invalid side")
      return self._str_map(f)
  
imports: from __future__ import annotations
  import functools
  import re
  import textwrap
  from typing import TYPE_CHECKING, Callable, Literal, cast
  import unicodedata
  import numpy
  from pandas._libs import lib
  import pandas._libs.missing
  import pandas._libs.ops
  from pandas.core.dtypes.missing import isna
  from pandas.core.strings.base import BaseStringArrayMethods
label_desc: Use image node_id 4 for calling the ObjectStringArrayMixin obj's underlying member method code with example usage: obj._str_pad(width, side, fillchar) and returns: self