0
Good night, could you do me the favor of how I change this code so that the user enters the 250 data and does not do a random.
data=pd.DataFrame(np.random.randn(250)) data.plot()
5 Antworten
+ 11
Luisa , if I understand you right, you want the user to input 250 data? If yes, you can try:
inp = []
num = int(input('how many numbers to input: '))
for i in range(num):
temp = input(f'enter the {i+1}. number: ')
if temp.isdigit():
inp.append(int(temp))
else:
break
print(inp)
Then use the list inp, and read it in pandas.
+ 1
Lothar you are probably right. Mine just asks the user how many random numbers he wants
+ 1
Lothar, thanks I'll try
+ 1
Thanks Benjamin
0
data=pd.DataFrame(np.random.randn(int(input())))
data.plot()