We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A minimal Hugo theme with nice theme color.
https://zhajiman.github.io/post/count_consecutive_zeros/
The text was updated successfully, but these errors were encountered:
这里 value_counts = unique_counts[np.searchsorted(unique, value_id)] , 中括号里面的结果就等于 value_id, 所以是不是直接 value_counts = unique_counts[value_id] 就行了?
Sorry, something went wrong.
感谢反馈,你说的对,括号里的结果就是 value_id,直接 value_counts = unique_counts[value_id] 就行。 unique 数组的值是连续的 [0, 1, 2, ..., n - 1],对应 0 到 n - 1 共 n 个 id,那 value_id 的值能直接作为 unique_counts 的索引。
value_id
value_counts = unique_counts[value_id]
unique
[0, 1, 2, ..., n - 1]
0
n - 1
n
unique_counts
No branches or pull requests
Numpy 系列:统计序列里零值连续出现的次数 - 炸鸡人博客
A minimal Hugo theme with nice theme color.
https://zhajiman.github.io/post/count_consecutive_zeros/
The text was updated successfully, but these errors were encountered: