vDataFrame[].sub

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

Substracts 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 [90]:
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 [91]:
titanic["age"].sub(2)
123
age
Numeric(21,3)
10.000
228.000
323.000
437.000
569.000
645.000
7[null]
822.000
934.000
1023.000
1143.000
1240.000
1339.000
1446.000
15[null]
1643.000
17[null]
1831.000
1926.000
2015.000
2147.000
2234.000
2344.000
24[null]
2525.000
26[null]
2745.000
2835.000
29[null]
3068.000
3137.000
3229.000
3348.000
3437.000
3534.000
36[null]
3728.000
3817.000
3962.000
40[null]
41[null]
4235.000
4345.000
4422.000
4569.000
4636.000
4744.000
48[null]
4943.000
5038.000
5153.000
5240.000
53[null]
5453.000
5540.000
56[null]
5748.000
5844.000
5948.000
6030.500
6156.000
6239.000
63[null]
64[null]
6527.000
6628.000
6728.000
6817.000
6944.000
7052.000
7126.000
7263.000
7342.000
7453.000
7545.000
7635.000
7756.000
7862.000
7963.000
8026.500
81[null]
8243.500
8321.000
8427.000
8516.000
8645.000
8736.000
8820.000
89[null]
9029.000
91[null]
9234.000
9353.000
9431.000
9559.000
9648.000
9754.000
9854.000
9922.000
100[null]
Out[91]:
Rows: 1-100 of 1234 | Column: age | Type: numeric(21,3)

See Also

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