In [1]:
import pandas as pd
import numpy as np
In [2]:
df = pd.read_csv('classes.csv', index_col=0)
df
Out[2]:
In [3]:
df[150:160]
Out[3]:
In [4]:
df2 = df[df['course number'] !='Class']
In [5]:
df2[150:160]
Out[5]:
In [6]:
df.size
Out[6]:
In [7]:
df2.size
Out[7]:
In [8]:
df.shape
Out[8]:
In [9]:
df2.shape
Out[9]:
In [10]:
df3 = df[df['course number'] == 'Class']
df3
Out[10]:
In [11]:
df3.shape
Out[11]:
In [12]:
df = df[df['course number'] !='Class']
In [13]:
df.shape
Out[13]:
In [14]:
cn = 'ENGR211'
In [15]:
cn
Out[15]:
In [16]:
dir(cn)
Out[16]:
In [17]:
cn.isalnum()
Out[17]:
In [18]:
cn.isdigit()
Out[18]:
In [19]:
nums = [s for s in cn if s.isdigit()]
In [20]:
nums
Out[20]:
In [21]:
num = ''.join(nums)
num
Out[21]:
In [22]:
dept_list = [s for s in cn[0:4] if s.isalpha()]
dept_list
Out[22]:
In [41]:
head = cn[0:4]
head
Out[41]:
In [39]:
head
Out[39]: