Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一連の 633 個の値があり、そのうちの ~50% は 0 です。理想的には、(コロプレス マッピングの目的で) を使用して値をビンに入れたいのですqcut()が、ビンのエッジが一意ではないため、エラーが発生します。データを分離し、ゼロ以外の値を分位し、それらを単一の列に再結合して、ゼロ値の値が 0 になり、分位値の値が になるようにする最善の方法は何categorical.label + 1ですか?
qcut()
categorical.label + 1
ゼロ値を に置き換えてNaN、期待どおりcut()にqcut()動作する場合。これらの行のビン値 (からCategorical.labels) は次の-1とおりです。
NaN
cut()
Categorical.labels
-1
df['density'].replace(to_replace=0, value=np.nan, inplace=True)