長方形の箱をつくっているコードがあってそれを編集しT字形にしたいのですがやり方がわかりません。
元のコーデで長方形をつくっている部分はおそらく以下の部分で
python
1from numpy import concatenate, where, array 2 3(中略) 4 5 indices = concatenate( (where( y <= -3.0 )[0], 6 where( y >= 3.0 )[0], 7 where( x >= 3.0 )[0], 8 where( x <= 0 )[0], 9 where( z <= 0 )[0]) )
ここを以下のように書き換えました
indices = concatenate( (where(y>=3.0 & x < 1.0)[0], where(y<=-3.0 & x < 1.0)[0], where( y <= -0.5 & x >= 1.0)[0], where( y >= 0.5 & x >= 1.0)[0], where( x >= 3.0 )[0], where( x <= 0 )[0], where( z <= 0 )[0]) ) ```しかしこのように書き換えると TypeError: ufunc 'bitwise_and' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' というようなエラーが出てしまいます。 この場合この書き換えは不可能なのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。