cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Properties as arrays or List without getting overwritten

jatinjaitleypro
Node Link

Is there a better way to write a current query? My current solution works but in properties it overwrites with the last POS value
I have 2 dataframes which I am trying to insert using py2neo. What I want is the POS of the word wild should be "POS": ["NOUN", "ADJ"]

The Query I am using is below:

NEXT = Relationship.type("NEXT")
parked = None
for index, row in df.iterrows():
    if parked is not None:
        start = Node('Word', text=parked.text, POS=parked.POS)
        end = Node('Word', text=row.text, POS=row.POS)
        graph.merge(NEXT(start, end), "Word", 'text')
    parked = row

The output should look like below:

The POS against the word "wild" should contain both: "POS": ["NOUN", "ADJ"]

0 REPLIES 0