Hi. It's a python and I got an error below comment
import numpy as np
arr=np.genfromtxt("/Volumes/Samsung SSD 860 EVO 500GB
Media/Download/primenumbers.txt", dtype=int)
arr=arr.reshape(-1,1)
arr.shape
def find_cat(x):
if x<= 300:
return '<=300'
elif x <= 600:
return '<=600'
else:
return '<=1000'
arr2 = np.apply_along_axis(find_cat, axis=1, arr=arr)
arr2 = arr2.reshape(-1,1)
arr3 = np.hstack((arr, arr2))
arr_300 = np.array((col[0] for col in arr3 if
col[i]=='<=300'), dtype=int)
arr_300
arr_300.shape
count_300=len(arr_300)
count_300
avg_300=round(np.mean(arr_300, 2)
avg_300
print("Number of items in category \ "<=300\"= (one), and average of numbers in this category =)
from print I don't know what is wrong please help me and fix the problems.
txt file is here -> https://drive.google.com/open?id=1F4c5svQG6Sv-JjqNjrq_FmpitVur4AmN
Hi. It's a python and I got an error below comment import numpy as np arr=np.genfromtxt("/Volumes/Samsung...
Hi it's my code for python
I almost finished my project but only one thing left which is
most confusing part please help me
I have to find most occurring ending character from a to z
For instance, output should be like this I have to find a to
z.
Words starting with ‘a’ end mostly with ‘O’
Words starting with ‘b’ end mostly with ‘O’
......
No words start with ‘O’(If there's no word in the character from a...