vDataFrame[].add

In [ ]:
vDataFrame[].add(x: float)

Adds the input element to the vcolumn.

Parameters

Name Type Optional Description
x
float
❌
If the vcolumn type is date like (date, datetime ...), the parameter 'x' will represent the number of seconds, otherwise it will represent a number.

Returns

vDataFrame : self.parent

Example

In [8]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic["age"])
123
age
Numeric(6,3)
12.000
230.000
325.000
439.000
571.000
647.000
7[null]
824.000
936.000
1025.000
1145.000
1242.000
1341.000
1448.000
15[null]
1645.000
17[null]
1833.000
1928.000
2017.000
2149.000
2236.000
2346.000
24[null]
2527.000
26[null]
2747.000
2837.000
29[null]
3070.000
3139.000
3231.000
3350.000
3439.000
3536.000
36[null]
3730.000
3819.000
3964.000
40[null]
41[null]
4237.000
4347.000
4424.000
4571.000
4638.000
4746.000
48[null]
4945.000
5040.000
5155.000
5242.000
53[null]
5455.000
5542.000
56[null]
5750.000
5846.000
5950.000
6032.500
6158.000
6241.000
63[null]
64[null]
6529.000
6630.000
6730.000
6819.000
6946.000
7054.000
7128.000
7265.000
7344.000
7455.000
7547.000
7637.000
7758.000
7864.000
7965.000
8028.500
81[null]
8245.500
8323.000
8429.000
8518.000
8647.000
8738.000
8822.000
89[null]
9031.000
91[null]
9236.000
9355.000
9433.000
9561.000
9650.000
9756.000
9856.000
9924.000
100[null]
Rows: 1-100 of 1234 | Column: age | Type: numeric(6,3)
In [9]:
titanic["age"].add(2)
123
age
Numeric(21,3)
14.000
232.000
327.000
441.000
573.000
649.000
7[null]
826.000
938.000
1027.000
1147.000
1244.000
1343.000
1450.000
15[null]
1647.000
17[null]
1835.000
1930.000
2019.000
2151.000
2238.000
2348.000
24[null]
2529.000
26[null]
2749.000
2839.000
29[null]
3072.000
3141.000
3233.000
3352.000
3441.000
3538.000
36[null]
3732.000
3821.000
3966.000
40[null]
41[null]
4239.000
4349.000
4426.000
4573.000
4640.000
4748.000
48[null]
4947.000
5042.000
5157.000
5244.000
53[null]
5457.000
5544.000
56[null]
5752.000
5848.000
5952.000
6034.500
6160.000
6243.000
63[null]
64[null]
6531.000
6632.000
6732.000
6821.000
6948.000
7056.000
7130.000
7267.000
7346.000
7457.000
7549.000
7639.000
7760.000
7866.000
7967.000
8030.500
81[null]
8247.500
8325.000
8431.000
8520.000
8649.000
8740.000
8824.000
89[null]
9033.000
91[null]
9238.000
9357.000
9435.000
9563.000
9652.000
9758.000
9858.000
9926.000
100[null]
Out[9]:
Rows: 1-100 of 1234 | Column: age | Type: numeric(21,3)

See Also

vDataFrame[].apply Applies a function to the input vcolumn.