Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HIFIS
Overall
Surveys
Survey 2021
Data
Commits
ca13a41c
Commit
ca13a41c
authored
3 years ago
by
Dworatzyk, Katharina
Browse files
Options
Downloads
Patches
Plain Diff
Remove invalid responses
parent
a98e5737
No related branches found
No related tags found
1 merge request
!7
Resolve "Screen free text answers"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
data-preparation.py
+16
-0
16 additions, 0 deletions
data-preparation.py
with
16 additions
and
0 deletions
data-preparation.py
+
16
−
0
View file @
ca13a41c
import
re
from
typing
import
Dict
,
List
,
Set
import
matplotlib.pyplot
as
plt
...
...
@@ -44,6 +45,20 @@ def _fix_typos(data_df: pd.DataFrame) -> pd.DataFrame:
return
data_df
def
_remove_answers_from_non_developers
(
data_df
:
pd
.
DataFrame
)
->
pd
.
DataFrame
:
# cases in which respondents stated that they were not developing software
# and hence could not answer the respective questions properly
non_developers
=
[
75
,
100
,
266
,
324
,
442
,
506
,
566
,
572
]
questions
=
[
question
for
question
in
data_df
.
columns
if
re
.
match
(
r
"
^Q020|Q021|Q022|Q025|Q026|Q027|Q028|Q029|Q038|Q039|Q040|Q041|
"
+
"
Q042|Q043|Q044
"
,
question
)
]
data_df
.
loc
[
non_developers
,
questions
]
=
None
return
data_df
def
_prepare_q001
(
data_df
:
pd
.
DataFrame
)
->
pd
.
DataFrame
:
"""
Categorize affiliation mentioned in free text answers keeping
"
Other
"
as default category.
"""
...
...
@@ -1345,3 +1360,4 @@ data = _prepare_q037(data_df=data)
data
=
_prepare_q038
(
data_df
=
data
)
data
=
_prepare_q043
(
data_df
=
data
)
data
=
_prepare_q044
(
data_df
=
data
)
data
=
_remove_answers_from_non_developers
(
data_df
=
data
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment