-
Notifications
You must be signed in to change notification settings - Fork 0
/
mastersheet_cleaner.py
64 lines (57 loc) · 3.75 KB
/
mastersheet_cleaner.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import pandas as pd
col_master = pd.read_csv("Wolbach_Collection_Mastersheet_v1.csv", sep=',', error_bad_lines=False, index_col=False, dtype='unicode')
list(col_master.columns.values)
col_master['MATERIAL'] = col_master['MATERIAL'].astype('|S')
col_master['COLLECTION'] = col_master['COLLECTION'].astype('|S')
col_master = col_master[~col_master.MATERIAL.str.contains("CDROM")]
col_master = col_master[~col_master.MATERIAL.str.contains("DATA")]
col_master = col_master[~col_master.MATERIAL.str.contains("DVDRO")]
col_master = col_master[~col_master.MATERIAL.str.contains("EQUIP")]
col_master = col_master[~col_master.MATERIAL.str.contains("ISSBD")]
col_master = col_master[~col_master.MATERIAL.str.contains("ISSLL")]
col_master = col_master[~col_master.MATERIAL.str.contains("ISSUE")]
col_master = col_master[~col_master.MATERIAL.str.contains("MAP")]
col_master = col_master[~col_master.MATERIAL.str.contains("MEDIA")]
col_master = col_master[~col_master.MATERIAL.str.contains("MFICH")]
col_master = col_master[~col_master.MATERIAL.str.contains("MFILM")]
col_master = col_master[~col_master.MATERIAL.str.contains("MIXED")]
col_master = col_master[~col_master.MATERIAL.str.contains("RCASS")]
col_master = col_master[~col_master.MATERIAL.str.contains("VCASS")]
col_master = col_master[~col_master.MATERIAL.str.contains("VDVD")]
col_master = col_master[~col_master.MATERIAL.str.contains("VIS")]
col_master = col_master[~col_master.COLLECTION.str.contains("CHTH")]
col_master = col_master[~col_master.COLLECTION.str.contains("CHTS")]
col_master = col_master[~col_master.COLLECTION.str.contains("DIGH")]
col_master = col_master[~col_master.COLLECTION.str.contains("DIGS")]
col_master = col_master[~col_master.COLLECTION.str.contains("DISSH")]
col_master = col_master[~col_master.COLLECTION.str.contains("DISSS")]
col_master = col_master[~col_master.COLLECTION.str.contains("EPHH")]
col_master = col_master[~col_master.COLLECTION.str.contains("EPHS")]
col_master = col_master[~col_master.COLLECTION.str.contains("FLWOS")]
col_master = col_master[~col_master.COLLECTION.str.contains("FOLCH")]
col_master = col_master[~col_master.COLLECTION.str.contains("FOLCS")]
col_master = col_master[~col_master.COLLECTION.str.contains("FOLH")]
col_master = col_master[~col_master.COLLECTION.str.contains("FOLS")]
col_master = col_master[~col_master.COLLECTION.str.contains("HASTH")]
col_master = col_master[~col_master.COLLECTION.str.contains("HDH")]
col_master = col_master[~col_master.COLLECTION.str.contains("HDS")]
col_master = col_master[~col_master.COLLECTION.str.contains("JRNLH")]
col_master = col_master[~col_master.COLLECTION.str.contains("JRNLS")]
col_master = col_master[~col_master.COLLECTION.str.contains("MFRMH")]
col_master = col_master[~col_master.COLLECTION.str.contains("MFRMH")]
col_master = col_master[~col_master.COLLECTION.str.contains("MFRMS")]
col_master = col_master[~col_master.COLLECTION.str.contains("PCHTH")]
col_master = col_master[~col_master.COLLECTION.str.contains("PCHTS")]
col_master = col_master[~col_master.COLLECTION.str.contains("PORTH")]
col_master = col_master[~col_master.COLLECTION.str.contains("PORTS")]
col_master = col_master[~col_master.COLLECTION.str.contains("REFS")]
col_master = col_master[~col_master.COLLECTION.str.contains("RESH")]
col_master = col_master[~col_master.COLLECTION.str.contains("RESS")]
col_master = col_master[~col_master.COLLECTION.str.contains("RREFS")]
col_master = col_master[~col_master.COLLECTION.str.contains("SMAS")]
col_master = col_master[~col_master.COLLECTION.str.contains("STORH")]
col_master = col_master[~col_master.COLLECTION.str.contains("STORS")]
col_master = col_master[~col_master.COLLECTION.str.contains("VIDH")]
col_master = col_master[~col_master.COLLECTION.str.contains("WIAH")]
col_master.to_csv("Wolbach_Collection_Mastersheet_v7.csv")
print('CSV saved')