Skip to content

Commit

Permalink
Merge pull request #17 from hearai/mplantyk_devel
Browse files Browse the repository at this point in the history
parse-hamnosys: Change NaN's to default values in for Handposition
  • Loading branch information
mplantykow authored Apr 4, 2022
2 parents 92cbf39 + b43f87e commit 13d4ef3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions parse-hamnosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import pandas as pd
import numpy as np
import math
import pdb


def equal_to_nan(a):
Expand Down Expand Up @@ -533,7 +532,7 @@ def main(args):
data.at[index,
"NONDominant - Handshape - Baseform"] = int(key)
Hamnosys_copy[index] = Hamnosys_copy[index][1:]
#Hashape base for doesn have to be found, see:
# Hashape base for doesn have to be found, see:
# 
if not(equal_to_nan(data.at[index, "NONDominant - Handshape - "
"Thumb position"])):
Expand Down Expand Up @@ -604,7 +603,7 @@ def main(args):
Hamnosys_copy[index] = Hamnosys_copy[index][1:]
char = Hamnosys_copy[index][0]
for key, value in UnknownSymbols2Dict.items():
if char==value:
if char == value:
Hamnosys_copy[index] = Hamnosys_copy[index][1:]
char = Hamnosys_copy[index][0]
if int(key) > 5:
Expand Down Expand Up @@ -826,6 +825,13 @@ def main(args):
if val_assigned == 1:
break

# Change NaN's to default values in for Handposition
for index, _ in data.iterrows():
if equal_to_nan(data.at[index, "Handposition - LR"]):
data.at[index, "Handposition - LR"] = 0
if equal_to_nan(data.at[index, "Handposition - TB"]):
data.at[index, "Handposition - TB"] = 14

# Save resultant file
df = data[args.columnnamesout]
df_success = df
Expand Down

0 comments on commit 13d4ef3

Please sign in to comment.