TypeError: 'float' object cannot be interpreted as an integer
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 576
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
python3 demo.py
Traceback (most recent call last):
File "demo.py", line 21, in
data1 = np.random.randn(ndim * 4 * nsamples / 5).reshape([4 * nsamples / 5,
File "mtrand.pyx", line 1220, in numpy.random.mtrand.RandomState.randn
File "mtrand.pyx", line 1377, in numpy.random.mtrand.RandomState.standard_normal
File "_common.pyx", line 558, in numpy.random._common.cont
TypeError: 'float' object cannot be interpreted as an integer
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running python3 demo.py and inspect demo.py line 21, where the failing np.random.randn call and reshape dimensions are constructed. Confirm the cause of the TypeError and verify that the demo runs successfully without the traceback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100