Jovian
⭐️
Sign In
In [1]:
import numpy as np
import pandas as pd
In [2]:
arr = np.random.rand(5,5)
In [3]:
np.random.randint(10,100,[5,5])
Out[3]:
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]])
In [4]:
arr = arr.astype(int)
In [5]:
pd.DataFrame(arr)
Out[5]:
In [6]:
students = []
subjects = []
In [7]:
sub = input("enter name of subject")
enter name of subjectk
In [8]:
sub
Out[8]:
'k'
In [9]:
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
In [10]:
subjects
Out[10]:
['h', 'j', 'k', 'l', 'm']
In [11]:
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
In [12]:
students
Out[12]:
['s', 'j', 'k', 'l', 'm']
In [13]:
data = pd.DataFrame(arr, columns=subjects, index=students)
In [14]:
data
Out[14]:
In [15]:
data.max(axis=1)
Out[15]:
s    0
j    0
k    0
l    0
m    0
dtype: int32
In [16]:
data.sum(axis=1)/5
Out[16]:
s    0.0
j    0.0
k    0.0
l    0.0
m    0.0
dtype: float64
In [17]:
data.sum()
Out[17]:
h    0
j    0
k    0
l    0
m    0
dtype: int64
In [18]:
data.iloc[1:3]
Out[18]:
In [19]:
data[data>40]
Out[19]:
In [20]:
data.idxmax()
Out[20]:
h    s
j    s
k    s
l    s
m    s
dtype: object
In [21]:
data.max(axis=1)
Out[21]:
s    0
j    0
k    0
l    0
m    0
dtype: int32
In [22]:
%matplotlib inline
In [23]:
data.plot.bar()
Out[23]:
<matplotlib.axes._subplots.AxesSubplot at 0xe6045084a8>
Notebook Image
In [24]:
import jovian

In [25]:
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
In [ ]: