I am have a Python program that reads data from an Oracle database into a Pandas DataFrame.
I then use Cypher to unwind the rows and create nodes with properties.
Sometimes the values returned from Oracle are null. In the case of numeric fields, the value of the property gets set to NaN.
Is there a way in Cypher to test a value in the unwound row and only create the property if the value meets a certain condition?
The query is below. I pass in a Pandas DataFrame that is populated from a query to Oracle. If a numeric field in Oracle is null, the DataFrame contains nan. These get created a properties with a value of NaN in Neo4j. I tried changing the nan to None in the DataFrame. WIth that, the properties get created with 0.0 as the value.
What I would really like to do is only create the property if there is a value.
Thanks!
I advice you to do the pre-treatment in Python, if you want the propery to not be created, the value must be null so None in your DataFrame. So replace NaN values by None.