# dask.dataframe.Series.str.pad

#### dataframe.Series.str.pad(width: [int](https://docs.python.org/3/builtins/functions.html#int), side: Literal['left', 'right', 'both'] = 'left', fillchar: [str](https://docs.python.org/3/builtins/stdtypes.html#str) = ' ')

Pad strings in the Series/Index up to width.

This docstring was copied from pandas.core.strings.accessor.StringMethods.pad.

Some inconsistencies with the Dask version may exist.

This function pads strings in a Series or Index to a specified width,
filling the extra space with a character of your choice. It provides
flexibility in positioning the padding, allowing it to be added to the
left, right, or both sides. This is useful for formatting strings to
align text or ensure consistent string lengths in data processing.

* **Parameters:**
  **width**
  : Minimum width of resulting string; additional characters will be filled
    with character defined in fillchar.

  **side**
  : Side from which to fill resulting string.

  **fillchar**
  : Additional character for filling, default is whitespace.
* **Returns:**
  Series or Index of object
  : Returns Series or Index with minimum number of char in object.

#### SEE ALSO
`Series.str.rjust`
: Fills the left side of strings with an arbitrary character. Equivalent to `Series.str.pad(side='left')`.

`Series.str.ljust`
: Fills the right side of strings with an arbitrary character. Equivalent to `Series.str.pad(side='right')`.

`Series.str.center`
: Fills both sides of strings with an arbitrary character. Equivalent to `Series.str.pad(side='both')`.

`Series.str.zfill`
: Pad strings in the Series/Index by prepending ‘0’ character. Equivalent to `Series.str.pad(side='left', fillchar='0')`.

### Examples

```pycon
>>> s = pd.Series(["caribou", "tiger"])
>>> s
0    caribou
1      tiger
dtype: str
```

```pycon
>>> s.str.pad(width=10)
0       caribou
1         tiger
dtype: str
```

```pycon
>>> s.str.pad(width=10, side="right", fillchar="-")
0    caribou---
1    tiger-----
dtype: str
```

```pycon
>>> s.str.pad(width=10, side="both", fillchar="-")
0    -caribou--
1    --tiger---
dtype: str
```

<!-- !! processed by numpydoc !! -->
