New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example has errors #5

Closed
ianozsvald opened this Issue Apr 20, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@ianozsvald
Owner

ianozsvald commented Apr 20, 2018

  • fix numpy example bug (below), fix the doc
  • check a = np.sqrt(a) example, the behaviour seems to have changed, fix the doc
  • confirm d = a * b + c behaviour has changed too, fix the doc

This looks like a change in numpy behaviour:

In [4]: a = np.ones(1e7)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-a702330132ac> in <module>()
----> 1 a = np.ones(1e7)

~/anaconda3/envs/ipython_memory_usage/lib/python3.6/site-packages/numpy/core/numeric.py in ones(shape, dtype, order)
    186 
    187     """
--> 188     a = empty(shape, dtype, order)
    189     multiarray.copyto(a, 1, casting='unsafe')
    190     return a

TypeError: 'float' object cannot be interpreted as an integer
In [4] used 0.6836 MiB RAM in 0.17s, peaked 0.00 MiB above current, total RAM usage 55.93 MiB

In [5]: a = np.ones(int(1e7))
In [5] used 76.1758 MiB RAM in 0.12s, peaked 0.00 MiB above current, total RAM usage 132.11 MiB

@pmalde

This comment has been minimized.

pmalde commented Apr 21, 2018

We need to import numpy as np in the README.md

@PawelLee

This comment has been minimized.

Contributor

PawelLee commented Apr 21, 2018

We need to say that we need to start ipython at the beginning

@pmalde

This comment has been minimized.

pmalde commented Apr 21, 2018

In the second part of the example where we have a two dimensional array setting the variable a should read as a = np.random.random((int(1e4),int(1e4))) also start the profiler again.

ianozsvald added a commit that referenced this issue Apr 21, 2018

Merge pull request #9 from Hexal7785/master
Fixed Issue "Example has errors  #5"
@ianozsvald

This comment has been minimized.

Owner

ianozsvald commented Apr 21, 2018

Thank you all! /cc @pmalde @PawelLee

@ianozsvald ianozsvald closed this Apr 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment