Pandas Adding Scalar Value To Numeric Column?
Given a dataframe like this ImageId | Width | Height | lb0 | x0 | y0 | lb1 | x1 | y1 | lb2 | x2 | y2 0 abc | 200 | 500 | ijk | 115| 8 | zyx | 15 | 16 | www | 23 | 42
Solution 1:
You probably don't have an int
dtype. Doing
df['x0'] = df['x0'].astype(int) + 1
should work
Post a Comment for "Pandas Adding Scalar Value To Numeric Column?"