cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Properties as arrays or List without getting overwritten

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