I want to insert nan instead of the float values using python code. Here is what I'm trying, and always end up with a typecast error:
example input_map <int, float> {1:0.9, 2:0.8, 3:NaN}
for key in input_map:
if (not math.isnan(input_map[key])):
out_values[key] = values[key]
else:
out_values[key] = float('nan')
Tried all the possible combinations in the else float(nan) | float('NaN') |float("NaN") etc
// Insert statement to be executed:
insert into keyspace.cfamily (var1, var2, map_data) values ('value1', 'value2', {1:0.9, 2:0.8, 3:nan})
cql error: cassandra.InvalidRequest: code=2200 [Invalid query] message="Unable to make float from 'nan'"
C* version details: cqlsh:keyspace> show version [cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]
Python version: $python3 --version Python 3.4.3
Thank you for your time !