Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
from numpy import *
roll_no= array([101,102,103,104,105,106,107],int)
print(roll_no)


On writing this code I am getting error :-

PS C:\Users\Ashish\csv, pandas> & C:/Users/Ashish/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/Ashish/csv, pandas/data.py"
Traceback (most recent call last):
File "bit_generator.pyx", line 40, in numpy.random.bit_generator
File "C:\Users\Ashish\AppData\Local\Programs\Python\Python39\lib\secrets.py", line 19, in <module>
from random import SystemRandom
ImportError: cannot import name 'SystemRandom' from 'random' (c:\Users\Ashish\csv, pandas\random.py)

What I have tried:

I tried to update my python and numpy version.
Posted
Updated 10-Jul-21 1:36am
Comments
Richard MacCutchan 10-Jul-21 4:40am    
I just tried this and it works fine. However there is a comment at random — Generate pseudo-random numbers — Python 3.9.6 documentation[^], that suggests SystemRandom is not available on all systems. What system are you using, and what version of Python?

for creating numpy array use this .
import numpy as np

roll_no=np.array([101,102,103,104,105,106,107],int)
roll_no
 
Share this answer
 
after reading this

python importing *[^]

have you tried to import only the classes that you need rather than them all, as the approach you have used will not import any "private" classes / objects
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900