forked from yusufaliozkan/zotero-intelligence-bibliography
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authors_dict.py
42 lines (41 loc) · 1.8 KB
/
authors_dict.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
import pandas as pd
df_authors = pd.read_csv('all_items.csv')
# df_authors['FirstName2'].fillna('', inplace=True)
df_authors['Author_name'] = df_authors['FirstName2'].apply(lambda x: x.split(', ') if isinstance(x, str) and x else x)
df_authors = df_authors.explode('Author_name')
df_authors.reset_index(drop=True, inplace=True)
df_authors = df_authors.dropna(subset=['FirstName2'])
name_replacements = {
'David Gioe': 'David V. Gioe',
'David Vincent Gioe': 'David V. Gioe',
'Michael Goodman': 'Michael S. Goodman',
'Michael S Goodman': 'Michael S. Goodman',
'Michael Simon Goodman': 'Michael S. Goodman',
'Thomas Maguire':'Thomas J. Maguire',
'Thomas Joseph Maguire':'Thomas J. Maguire',
'Huw John Davies':'Huw J. Davies',
'Huw Davies':'Huw J. Davies',
'Philip H.J. Davies':'Philip H. J. Davies',
'Philip Davies':'Philip H. J. Davies',
'Dan Lomas':'Daniel W. B. Lomas',
'Richard Aldrich':'Richard J. Aldrich',
'Richard J Aldrich':'Richard J. Aldrich',
'Steven Wagner':'Steven B. Wagner',
'Daniel Larsen':'Daniel R. Larsen',
'Daniel Richard Larsen':'Daniel R. Larsen',
'Loch Johnson':'Loch K. Johnson',
'Sir David Omand Gcb':'David Omand',
'Sir David Omand':'David Omand',
'John Ferris':'John R. Ferris',
'John Robert Ferris':'John R. Ferris',
'Richard Betts':'Richard K. Betts',
'Wesley Wark':'Wesley K. Wark',
'Michael Handel':'Michael I. Handel',
'Michael I Handel':'Michael I. Handel',
'Matthew Seligmann':'Matthew S. Seligmann',
'Christopher Andrew':'Christopher M. Andrew',
'STEPHEN MARRIN':'Stephen Marrin',
'Christopher Moran':'Christopher R. Moran',
'Christopher R Moran':'Christopher R. Moran'
}
df_authors['Author_name'] = df_authors['Author_name'].map(name_replacements).fillna(df_authors['Author_name'])