-
Notifications
You must be signed in to change notification settings - Fork 0
/
num.py
37 lines (34 loc) · 976 Bytes
/
num.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# from numpy import *
# import math
# import numpy.matlib
print(5+3)
# print("shape",a.shape)
# print("diagonal elements",a.diagonal())
# print("1X1:",a[0,:1])
# print("1X2:",a[0,1:2])
# print("1X3:",a[0,2:])
# print("2X1:",a[1,:1])
# print("2X2:",a[1,1:2])
# print("2X3",a[1,2:])
# print("3X1",a[2,:1])
# print("3X2",a[2,1:2])
# print("3X3",a[2,2:])
# x="john"
# y="paul"
# z="parag"
# a1 = np.array([x,y,z])
# print(a1)
# print(a1[:3])
# c1 = np.array([2,3,4,5,6])
# c2 = np.array([4,16,25,9,7])
# for i in range(len(c2)):
# print(f"Sr.{i+1} Squareroot of {c2[i]} is {math.sqrt(c2[i])}")
# print(f"Sr.{i+1} Factorial of {c2[i]} is {math.factorial(c2[i])}")
# print(f"Sr.{i+1} Fab of {c2[i]} is {math.fabs(c2[i]/4)}")
# print(f"Sr.{i+1} modf of {c2[i]} is {math.modf(c2[i]/4)}\n")
# print("numpy version",np.__version__)
# arr = np.array([10, 15, 20, 25, 30, 35, 40])
# sum = arr.sum()
# print("ssss",sum)
# print(arr[:6:2])
# print(print(arr[::2]))