Skip to content

Instantly share code, notes, and snippets.

@smzn
Created January 7, 2024 01:28
Show Gist options
  • Save smzn/0e446b57c012b5214c47ff41ec25fedb to your computer and use it in GitHub Desktop.
Save smzn/0e446b57c012b5214c47ff41ec25fedb to your computer and use it in GitHub Desktop.
各行の合計で各要素を割って推移確率行列を作成
# 各行の合計で各要素を割って推移確率行列を作成
transition_probability_matrix = filtered_matrix.div(filtered_matrix.sum(axis=1), axis=0)
# 結果を表示
transition_probability_matrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment