Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 1.79 KB

series.str.capitalize.md

File metadata and controls

52 lines (42 loc) · 1.79 KB
description
Capitalize the first character of each string

Series.str.capitalize

danfo.Series.str.capitalize(options) [source]

Parameters Type Description Default
options Object inplace: Whether to perform the operation in-place or not.

{

inplace: false

}

Returns: Series (String element)

Example

Convert the first character of a string to capital letter

{% tabs %} {% tab title="Node" %}

const dfd = require("danfojs-node")

let data = ['lower boy', 'capitals', 'sentence', 'swApCaSe']
let sf = new dfd.Series(data)
sf.str.capitalize().print()

{% endtab %}

{% tab title="Browser" %}

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="Output" %}

╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ Lower boy            ║
╟───┼──────────────────────╢
║ 1 │ Capitals             ║
╟───┼──────────────────────╢
║ 2 │ Sentence             ║
╟───┼──────────────────────╢
║ 3 │ Swapcase             ║
╚═══╧══════════════════════╝

{% endtab %} {% endtabs %}