pandas 1.4.2

NotesParametersRaisesReturnsBackRef
join(self, sep)

If the elements of a Series are lists themselves, join the content of these lists using the delimiter passed to the function. This function is an equivalent to str.join .

Notes

If any of the list items is not a string object, the result of the join will be NaN .

Parameters

sep : str

Delimiter to use between list entries.

Raises

AttributeError

If the supplied Series contains neither strings nor lists.

Returns

Series/Index: object

The list entries concatenated by intervening occurrences of the delimiter.

Join lists contained as elements in the Series/Index with passed delimiter.

See Also

Series.str.split

Split strings around given separator/delimiter.

str.join

Standard library version of this method.

Examples

Example with a list that contains non-string elements.

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series([['lion', 'elephant', 'zebra'],
...  [1.1, 2.2, 3.3],
...  ['cat', np.nan, 'dog'],
...  ['cow', 4.5, 'goat'],
...  ['duck', ['swan', 'fish'], 'guppy']])
... s 0 [lion, elephant, zebra] 1 [1.1, 2.2, 3.3] 2 [cat, nan, dog] 3 [cow, 4.5, goat] 4 [duck, [swan, fish], guppy] dtype: object

Join all lists using a '-'. The lists containing object(s) of types other than str will produce a NaN.

This example is valid syntax, but we were not able to check execution
>>> s.str.join('-')
0    lion-elephant-zebra
1                    NaN
2                    NaN
3                    NaN
4                    NaN
dtype: object
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.strings.accessor.StringMethods.cat

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/strings/accessor.py#1023
type: <class 'function'>
Commit: