Code Monkey home page Code Monkey logo

Comments (3)

ilumsden avatar ilumsden commented on July 18, 2024

@JBlaschke how large is the Graph that you're testing with? When Pandas serializes into any format (e.g., pickle, HDF5, SQL, etc.), it will serialize any cells with Object type data with pickle. This could become a problem with the index of the DataFrame because it contains nodes in the Graph. Under normal circumstances, each of these nodes will contain two lists: one of its parent nodes and one of its children nodes. So, when Pandas tries to pickle a node, it will recursively try to pickle each child and parent node. As a result, for large or highly connected graphs, it would be pretty easy to reach Python's (relatively small) recursion depth limit.

This is why, in developing #272 for saving GraphFrames to the filesystem, I disconnect the graph and encode that info with integers in a copy of the DataFrame.

@pearce8 @bhatele, we should probably discuss this during our next meeting.

from hatchet.

ilumsden avatar ilumsden commented on July 18, 2024

This library could be useful for fixing this issue: https://github.com/jmcarpenter2/swifter

It's a Pandas plugin that automatically decides if vectorization, Dask, or Pandas is faster and runs the apply function using that method. The syntax is pretty nice too. Instead of df.apply(func), Swifter's syntax is df.swifter.apply(func).

Only question is: do we want to add more dependencies?

from hatchet.

ilumsden avatar ilumsden commented on July 18, 2024

Actually, we probably don't want to use that package. It requires Pandas 1.0.0 or higher, and that version of Pandas doesn't support Python 2.7 (officially, it might work, but it's not a guarantee).

from hatchet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.