Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

specify the number of decimals in a dataframe

import numpy as np
import pandas as pd 

some_numbers = np.random.ranf(5)

df = pd.DataFrame({'random_numbers':some_numbers})

rounded_df = df.round(decimals=2)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #number #decimals #dataframe
ADD COMMENT
Topic
Name
3+8 =