Git Product home page Git Product logo

Comments (3)

aestrivex avatar aestrivex commented on July 3, 2024

I am not initially able to reproduce this error using randomly generated
matrices with a range of components.

Can you provide what matrix you are using to generate this error? Also what
version of networkx are you using?

On Wed, Apr 8, 2015 at 5:18 PM, birkantunc [email protected] wrote:

The line

cptsizes=np.zeros(len(cpts))

in get_components() raises the following error

*** TypeError: object of type 'generator' has no len()

One way to get rid of it is using

cptsizes=np.zeros(len(list(cpts)))

instead.


Reply to this email directly or view it on GitHub
#8.

from bctpy.

birkantunc avatar birkantunc commented on July 3, 2024

I could not figure out how to upload the matrix using github interface. I'm using the latest version of networkx (1.9.1)

from bctpy.

aestrivex avatar aestrivex commented on July 3, 2024

I was using networkx 1.8.1, because that's the version that came with my python distribution and I've never really had a reason to update it.

In the meantime I guess the API has changed to return a generator instead of a list, and I can reproduce your error on the newer version.

Thanks for the report, it is fixed now

from bctpy.

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.