# MATCH hundreds of thousands of nodes and return in dataframe chunks

**URL:** <https://community.neo4j.com/t/match-hundreds-of-thousands-of-nodes-and-return-in-dataframe-chunks/28514>\
**Category:** Python\
**Tags:** apoc, cypher\
**Created:** [November 5, 2020, 10:58pm UTC](https://community.neo4j.com/t/match-hundreds-of-thousands-of-nodes-and-return-in-dataframe-chunks/28514 "2020-11-05T22:58:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.lin](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/richard.lin/32/4675_2.png) [@richard.lin](https://community.neo4j.com/u/richard.lin)\
**Post date:** [November 5, 2020, 10:58pm UTC](https://community.neo4j.com/t/match-hundreds-of-thousands-of-nodes-and-return-in-dataframe-chunks/28514/1 "2020-11-05T22:58:53Z")

</div>

```auto
def query(text_query, driver, db = None):
     try: 
         session = driver.session(database=db) 
         response = list(session.run(text_query))
     except Exception as e:
         print("Query failed:", e)
     finally: 
        if session is not None:
            session.close()
     return response

text = "MATCH (n:technique) WHERE exists(n.embedding_vector) RETURN DISTINCT n.common_ds_cafe_id, n.embedding_vector"
tech_dtf_data = pd.DataFrame([dict(_) for _ in query(text, db='neo4j', driver = driver)])
tech_dtf_data['label'] = 'technique'
print("Techniques loaded:", tech_dtf_data.shape)

```

I have a function query which returns my results as lists. I am also able to load my data into pandas dataframes. I am wondering if it is possible to load hundreds of thousands of node properties into a single dataframe in chunks. I looked into apoc.periodic.iterate but that seems to only return amount of rows processed and requires updates to node. I only wish to return node property information in chunks.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/maxim/32/3913_2.png) [@maxim](https://community.neo4j.com/u/maxim)\
**Post date:** [October 27, 2021, 2:44pm UTC](https://community.neo4j.com/t/match-hundreds-of-thousands-of-nodes-and-return-in-dataframe-chunks/28514/2 "2021-10-27T14:44:43Z")

</div>

I think that you can use commit to achieve it: [apoc.periodic.commit - APOC Extended Documentation](https://neo4j.com/labs/apoc/4.1/overview/apoc.periodic/apoc.periodic.commit/)
