You are on page 1of 4

statistics

===============
================== ==================================================
Function Description
================== ==================================================
mean Arithmetic mean (average) of data.
mode Mode (most common value) of data.
median Median (middle value) of data.

How to use module properties


=============================
1)import modulename
modulename.propertyname()

2)from modulename import propertyname


propertyname()

or

from modulename import propertyname1,propertyname2


propertyname()

of

from modulename import *


propertyname()

How to create an alias for the module name


=========================================

import modulename as aliasname

json module name in python

How to read json file with python


How to write data to the json file with python

======================================================
package
==========
=>package is a collection modules

sound/ Top-level package


__init__.py Initialize the sound package
formats/ Subpackage for file format conversions
__init__.py
wavread.py
wavwrite.py
aiffread.py
aiffwrite.py
auread.py
auwrite.py
...
effects/ Subpackage for sound effects
__init__.py
echo.py
surround.py
reverse.py
...
filters/ Subpackage for filters
__init__.py
equalizer.py
vocoder.py
karaoke.py
...

https://docs.python.org/3/tutorial/modules.html#packages

The __init__.py files are required to make Python treat directories containing the
file as packages

==================script file =================


import statistics as stat
import arithmatic as arith
import math as m
import pandas as pd
def sum(x,y):
return(100)
a=100
#arithmatic#
print("###############from arithmatic############")
k=arith.sum(10,20)
print("Sum of 10 and 20 is:",k)
print(arith.a)
print(a)

"""

from arithmatic import sum,sub


from statistics import *
from math import sqrt
from pandas import *

def sum(x,y):
return(100)

print("###############from arithmatic############")
k=sum(10,20)
print("Sum of 10 and 20 is:",k)

from arithmatic import sum,sub


from statistics import *
from math import sqrt
from pandas import *
print("###############from arithmatic############")
k=sum(10,20)
print("Sum of 10 and 20 is:",k)
k1=sub(10,20)
print("Sub of 10 and 20 is:",k1)
print("############From statistics module############")
x=mean([3,4,5,6,7,10])
print(x)
x1=mode([3,4,3,3,3,3,5,6])
print(x1)
x2=median([3,4,5,6,7])
print(x2)
print("#################From math##############")
s1=sqrt(25)
print("Sqrt of 25 is:",s1)

print("#############from pandas############")
mydataset = {
'subjects': ["maths", "english", "telugu"],
'Marks': [90, 79, 82]
}

myvar = DataFrame(mydataset)

print(myvar)

import statistics as stat


import arithmatic as arith
import math as m
import pandas as pd

#arithmatic#
print("###############from arithmatic############")
k=arith.sum(10,20)
print("Sum of 10 and 20 is:",k)
k1=arith.sub(10,20)
print("Sub of 10 and 20 is:",k1)
print(arith.a)
print("#################From math##############")
s1=m.sqrt(25)
print("Sqrt of 25 is:",s1)

print("#############from pandas############")
mydataset = {
'subjects': ["maths", "english", "telugu"],
'Marks': [90, 79, 82]
}
myvar = pd.DataFrame(mydataset)

print(myvar)
print("#############from statistics############")

x=stat.mean([3,4,5,6,7,10])
print(x)
x1=stat.mode([3,4,3,3,3,3,5,6])
print(x1)
x2=stat.median([3,4,5,6,7])
print(x2)

import statistics
x=statistics.mean([3,4,5,6,7,10])
print(x)
x1=statistics.mode([3,4,3,3,3,3,5,6])
print(x1)
x2=statistics.median([3,4,5,6,7])
print(x2)

"""

You might also like