Description
Describe the issue:
When I was trying to create a dtype mapping dict like below:
d = {
np.float64: "some_string_float64",
np.float32: "some_string_float32"
}
The condition np.float64 in d
or np.float64 in d.keys()
will gives False
.
However, if I convert the keys into list, it will gives True
.
I am curious if this is a bug?
Reproduce the code example:
import numpy as np
mock_downgrade_map = {
np.float64: np.float32,
np.int64: np.int32
}
print(np.float64 in mock_downgrade_map ) # Gives False
print(np.float64 in mock_downgrade_map.keys() ) # Gives False
Sorry but I found out it was actually the pandas columns dtype I'm comparing with, and I suppose it should be reported to pandas.
Error message:
No response
Runtime information:
[{'numpy_version': '1.26.1',
'python': '3.10.11 (main, May 16 2023, 00:28:57) [GCC 11.2.0]',
'uname': uname_result(system='Linux', node='HZ_GPU_04', release='5.4.0-80-generic', version='#90~18.04.1-Ubuntu SMP Tue Jul 13 19:40:02 UTC 2021', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_SKX',
'AVX512_CLX'],
'not_found': ['AVX512_KNL',
'AVX512_KNM',
'AVX512_CNL',
'AVX512_ICL']}},
{'architecture': 'SkylakeX',
'filepath': '/DATA/home/yuehc/.conda/envs/py310tf211/lib/python3.10/site-packages/numpy.libs/libopenblas64_p-r0-0cf96a72.3.23.dev.so',
'internal_api': 'openblas',
'num_threads': 64,
'prefix': 'libopenblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.23.dev'}]
Context for the issue:
No response