1

I am trying to fit power law with powerlaw.py:

data = [1.7, 3.2, 4.3, 2.1, 0.9, 3.3, 1.2, 4.3]
fit = powerlaw.Fit(data)

I'm getting the warning:

IndexError: 0-d arrays can only use a single () or a list of newaxes
(and a single ...) as an index

I've tested also data which were used in these code examples and I have always the same problem.

Why this happens?

1 Answer 1

0

I just ran code:

In [1]: import powerlaw

In [2]: data = [1.7, 3.2, 4.3, 2.1, 0.9, 3.3, 1.2, 4.3]

In [3]: fit = powerlaw.Fit(data) Calculating best minimal value for power law fit /usr/lib/python2.7/site-packages/powerlaw-1.3-py2.7.egg/powerlaw.py:686: RuntimeWarning: invalid value encountered in divide (Theoretical_CDF * (1 - Theoretical_CDF))

In [4]: fit.sigma Out[4]: 0.37880479849893711

might want to check for a bug elsewhere... if not might be a version error

Sign up to request clarification or add additional context in comments.

1 Comment

Do you by any chance know how to get the C - scaling factor?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.