-
Notifications
You must be signed in to change notification settings - Fork 0
ball_velocityのメソッドを分割 #85
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
ball_velocity内のCSVファイルへの格納コマンドをstore_ball_positionの書き方を見ながら分ける。
new_velocity_data = [[speed, direction_deg, state1, state2, frame2]] # 新しいボール速度のデータ
df = pd.DataFrame(new_velocity_data, columns=["speed", "direction", "state1", "state2", "frame_number"]) # ボール速度のデータフレームを作成
ball_velocity_path = os.path.join(path, "ball_velocity.csv") # ボール速度のCSVファイルパス
if not os.path.isdir(path):
os.mkdir(path) # 出力先ディレクトリが存在しない場合は作成
if not os.path.exists(ball_velocity_path):
df.to_csv(ball_velocity_path, mode='w', header=True, index=False) # ボール速度のCSVファイルが存在しない場合は新規作成
else:
df.to_csv(ball_velocity_path, mode='a', header=False, index=False) # 存在する場合は追記
↑これを別のメソッドにする
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers