Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

absolute value columns pandas


import pandas as pd

df = pd.DataFrame(data={'count':[1, -1, 2, -2, 3, -3]})

df['count'] = df['count'].abs()

print(df)
   count
#0      1
#1      1
#2      2
#3      2
#4      3
#5      3

Source by devarama.com #
 
PREVIOUS NEXT
Tagged: #absolute #columns #pandas
ADD COMMENT
Topic
Name
8+2 =