python std code example

Example 1: numpy standard deviation

import numpy as np
data = [68,86,36,57,24,46,32,53] #define some data
data_std = np.std(data) #outputs 19.00493356999703

Example 2: numpy calculate standard deviation

import numpy
numbers = [1,5,6,7,9,11,13]
standard = numpy.std(numbers) #Calculates standard deviation
print(standard)

Example 3: standard deviation python

import numpy as np
values=[1,10,100]
print(np.std(values))
values=[1,10,100,np.nan]
print(np.nanstd(values))

Example 4: str in python

#Strings or alphabets or -, +, *, /, ", :, ;, (, ) etc
#If there is a string then it means the value will be inside coates
a = 'Roger'
print(a, 'is my name')