import numpy as np
import pandas as pd
arr = np.random.rand(5,5)
np.random.randint(10,100,[5,5])
array([[88, 95, 93, 55, 73],
[90, 19, 90, 30, 11],
[60, 86, 96, 92, 46],
[37, 89, 34, 97, 49],
[58, 24, 55, 91, 88]])
arr = arr.astype(int)
pd.DataFrame(arr)
students = []
subjects = []
sub = input("enter name of subject")
enter name of subjectk
sub
'k'
for i in range(5):
stu = input("enter name of subject")
subjects.append(stu)
enter name of subjecth
enter name of subjectj
enter name of subjectk
enter name of subjectl
enter name of subjectm
subjects
['h', 'j', 'k', 'l', 'm']
for i in range(5):
stu = input("enter name of students")
students.append(stu)
enter name of studentss
enter name of studentsj
enter name of studentsk
enter name of studentsl
enter name of studentsm
students
['s', 'j', 'k', 'l', 'm']
data = pd.DataFrame(arr, columns=subjects, index=students)
data
data.max(axis=1)
s 0
j 0
k 0
l 0
m 0
dtype: int32
data.sum(axis=1)/5
s 0.0
j 0.0
k 0.0
l 0.0
m 0.0
dtype: float64
data.sum()
h 0
j 0
k 0
l 0
m 0
dtype: int64
data.iloc[1:3]
data[data>40]
data.idxmax()
h s
j s
k s
l s
m s
dtype: object
data.max(axis=1)
s 0
j 0
k 0
l 0
m 0
dtype: int32
%matplotlib inline
data.plot.bar()
<matplotlib.axes._subplots.AxesSubplot at 0xe6045084a8>
import jovian
jovian.commit()
[jovian] Saving notebook..
[jovian] Creating a new notebook on https://jvn.io
[jovian] Uploading notebook..
[jovian] Capturing environment..
[jovian] Committed successfully! https://jvn.io/shibanimoharana7/f607d60f6c71498cb3192f2e5ea81200