Skip to content

Commit d836e5b

Browse files
Rosna ThomasRosna Thomas
Rosna Thomas
authored and
Rosna Thomas
committed
added contributor field in data/csv
1 parent f20076a commit d836e5b

File tree

6 files changed

+3101
-3082
lines changed

6 files changed

+3101
-3082
lines changed

data/citation.csv

+317-298
Large diffs are not rendered by default.

data/description.csv

+337-337
Large diffs are not rendered by default.

data/installation.csv

+930-930
Large diffs are not rendered by default.

data/invocation.csv

+1,136-1,136
Large diffs are not rendered by default.

data/none.csv

+371-371
Large diffs are not rendered by default.

helper_scripts/splitcsvcategory.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,38 @@
88
df.sort_values(by=['URL', 'category'], inplace=True)
99
if os.path.exists('../data/none.csv'):
1010
df_none=pd.read_csv('../data/none.csv')
11-
df_none=df_none.append((df[df['category']=='none'])[['URL', 'excerpt']])
11+
df_none=df_none.append((df[df['category']=='none'])[['URL','contributor', 'excerpt']])
1212
df_none.drop_duplicates(subset="excerpt").to_csv(path_or_buf='../data/none.csv', index=False)
1313
else:
14-
(df[df['category']=='none']) [['URL', 'excerpt']].to_csv(path_or_buf='../data/none.csv', index=False)
14+
(df[df['category']=='none']) [['URL','contributor', 'excerpt']].to_csv(path_or_buf='../data/none.csv', index=False)
1515

1616

1717
if os.path.exists('../data/description.csv'):
1818
df_description=pd.read_csv('../data/description.csv')
19-
df_description=df_description.append((df[df['category']=='description']) [['URL', 'excerpt']])
19+
df_description=df_description.append((df[df['category']=='description']) [['URL','contributor', 'excerpt']])
2020
df_description.drop_duplicates(subset="excerpt").to_csv(path_or_buf='../data/description.csv', index=False)
2121
else:
22-
(df[df['category']=='description']) [['URL', 'excerpt']].to_csv(path_or_buf='../data/description.csv', index=False)
22+
(df[df['category']=='description']) [['URL', 'contributor','excerpt']].to_csv(path_or_buf='../data/description.csv', index=False)
2323

2424

2525
if os.path.exists('../data/installation.csv'):
2626
df_installation=pd.read_csv('../data/installation.csv')
27-
df_installation=df_installation.append((df[df['category']=='installation'])[['URL', 'excerpt']])
27+
df_installation=df_installation.append((df[df['category']=='installation'])[['URL','contributor', 'excerpt']])
2828
df_installation.drop_duplicates(subset="excerpt").to_csv(path_or_buf='../data/installation.csv', index=False)
2929
else:
30-
(df[df['category']=='installation'])[['URL', 'excerpt']].to_csv(path_or_buf='../data/installation.csv', index=False)
30+
(df[df['category']=='installation'])[['URL','contributor', 'excerpt']].to_csv(path_or_buf='../data/installation.csv', index=False)
3131

3232

3333
if os.path.exists('../data/invocation.csv'):
3434
df_invocation=pd.read_csv('../data/invocation.csv')
35-
df_invocation=df_invocation.append((df[df['category']=='invocation'])[['URL', 'excerpt']])
35+
df_invocation=df_invocation.append((df[df['category']=='invocation'])[['URL','contributor', 'excerpt']])
3636
df_invocation.drop_duplicates(subset="excerpt").to_csv(path_or_buf='../data/invocation.csv', index=False)
3737
else:
38-
(df[df['category']=='invocation']).to_csv(path_or_buf='../data/invocation.csv', index=False)
38+
(df[df['category']=='invocation'])[['URL', 'contributor','excerpt']].to_csv(path_or_buf='../data/invocation.csv', index=False)
3939

4040
if os.path.exists('../data/citation.csv'):
4141
df_citation=pd.read_csv('~/Documents/ISI2019/SM2KG/data/citation.csv')
42-
df_citation=df_citation.append((df[df['category']=='citation'])[['URL', 'excerpt']])
42+
df_citation=df_citation.append((df[df['category']=='citation'])[['URL', 'contributor','excerpt']])
4343
df_citation.drop_duplicates(subset="excerpt").to_csv(path_or_buf='../data/citation.csv', index=False)
4444
else:
45-
(df[df['category']=='citation'])[['URL', 'excerpt']].to_csv(path_or_buf='../data/citation.csv', index=False)
45+
(df[df['category']=='citation'])[['URL','contributor','excerpt']].to_csv(path_or_buf='../data/citation.csv', index=False)

0 commit comments

Comments
 (0)