Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Roelofsen, Hans
benb_utils
Commits
284ec736
Commit
284ec736
authored
Jan 12, 2022
by
Roelofsen, Hans
Browse files
typo in species csv
parent
31a89bd3
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
dkq.py
View file @
284ec736
...
...
@@ -105,24 +105,24 @@ if __name__ == '__main__':
#
d = {'S02': 'V',
#
'S06': 'E',
#
'S09': 'P'}
#
full = pd.read_csv(r'w:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v06_2019_12_09\01_Base_species_name.csv', sep=',', comment='#')
#
full.set_index(keys='Species_code', drop=False, inplace=True)
#
full['taxon'] = full.index.str.slice(0,3).map(d)
#
sel468 = pd.read_csv(r'W:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v05_2021_04_08\09_MNP_versie4_Group_Species_valid model_468.csv', sep=',', index_col='Species_code')
#
sel281 = pd.read_csv(r'W:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v05_2021_04_08\09_MNP_versie4_Species_group_valid_model_280.csv', sep=',', index_col='Species_code')
#
sel146 = pd.read_csv(r'W:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v06_2019_12_09\09_MNP_versie4_Species_group_valid_model_typisch_146.csv', sep=',', index_col='Species_code')
#
in468 = full.index.intersection(sel468.index)
#
in281 = full.index.intersection(sel281.index)
#
in146 = full.index.intersection(sel146.index)
#
full.loc[:, 'sel468'] = 0
#
full.loc[in468, 'sel468'] = 1
#
full.loc[:, 'sel281'] = 0
#
full.loc[in281, 'sel281'] =
0
#
full.loc[:, 'sel1
018
'] =
1
#
full.loc[
:
, 'sel146'] =
0
#
full.loc[
in146
, 'sel1
46
'] = 1
#
full.loc[:, 'selall'] = 1
#
full.to_clipboard(sep=',', index=False)
d
=
{
'S02'
:
'V'
,
'S06'
:
'E'
,
'S09'
:
'P'
}
full
=
pd
.
read_csv
(
r
'w:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v06_2019_12_09\01_Base_species_name.csv'
,
sep
=
','
,
comment
=
'#'
)
full
.
set_index
(
keys
=
'Species_code'
,
drop
=
False
,
inplace
=
True
)
full
[
'taxon'
]
=
full
.
index
.
str
.
slice
(
0
,
3
).
map
(
d
)
sel468
=
pd
.
read_csv
(
r
'W:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v05_2021_04_08\09_MNP_versie4_Group_Species_valid model_468.csv'
,
sep
=
','
,
index_col
=
'Species_code'
)
sel281
=
pd
.
read_csv
(
r
'W:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v05_2021_04_08\09_MNP_versie4_Species_group_valid_model_280.csv'
,
sep
=
','
,
index_col
=
'Species_code'
)
sel146
=
pd
.
read_csv
(
r
'W:\PROJECTS\QMAR\MNP-SNL-ParameterSet\Parameters_v06_2019_12_09\09_MNP_versie4_Species_group_valid_model_typisch_146.csv'
,
sep
=
','
,
index_col
=
'Species_code'
)
in468
=
full
.
index
.
intersection
(
sel468
.
index
)
in281
=
full
.
index
.
intersection
(
sel281
.
index
)
in146
=
full
.
index
.
intersection
(
sel146
.
index
)
full
.
loc
[:,
'sel468'
]
=
0
full
.
loc
[
in468
,
'sel468'
]
=
1
full
.
loc
[:,
'sel281'
]
=
0
full
.
loc
[
in281
,
'sel281'
]
=
1
full
.
loc
[:,
'sel1
46
'
]
=
0
full
.
loc
[
in146
,
'sel146'
]
=
1
full
.
loc
[
:
,
'sel1
018
'
]
=
1
full
.
loc
[:,
'selall'
]
=
1
full
.
to_clipboard
(
sep
=
','
,
index
=
False
)
resources/mnp_species.csv
View file @
284ec736
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment