Skip to content

Commit

Permalink
Merge pull request #1 from kaikreuzer/fixdeprecationwarning
Browse files Browse the repository at this point in the history
Fix deprecation warning in output
  • Loading branch information
c-a-schiller authored Mar 26, 2024
2 parents d63503a + 85ee943 commit 1441d48
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Calliope-Rennspiel/Python/ki-datenlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,16 @@ def on_press(key):
if line.startswith("P") or line.startswith("\x00") or line.startswith("R"):
print("Header erkannt - ignorieren")
else:
print("Nutzdaten erkannt - Übernahme in DataFrame")
if line[:1]=="":
if line[:1] == "":
print("Leerdaten erkannt - Überspringen")
else:
collect = collect.append({'PlayerPos': line[:1],
'Car1Pos': line[2:3],
'Car2Pos': line[4:5],
'Car3Pos': line[6:7],
'Car4Pos': line[8:9],
'Car5Pos': line[10:11],
'Action': line[12:13]},
ignore_index=True)
collect = pd.concat([collect, pd.DataFrame({'PlayerPos': [line[:1]],
'Car1Pos': [line[2:3]],
'Car2Pos': [line[4:5]],
'Car3Pos': [line[6:7]],
'Car4Pos': [line[8:9]],
'Car5Pos': [line[10:11]],
'Action': [line[12:13]]})], ignore_index=True)

# Schließen der seriellen Schnittstelle und Ausgabe der gesammelten Daten
ser.close()
Expand Down

0 comments on commit 1441d48

Please sign in to comment.