student_record.txt not found.
why do we use np.mean(L,0) for calculating mean scored by all students in each subject.
In [1]: sudo apt-get install python3-pip File "<ipython-input-1-adffa9420756>", line 1 sudo apt-get install python3-pip ^SyntaxError: invalid syntax
L=np.loadtxt("football.txt",usecols=(1,2),delimiter=',')Traceback (most recent call last): File "<ipython-input-2-8d4e42947062>", line 1, in <module> L=np.loadtxt("football.txt",usecols=(1,2),delimiter=',') File "C:\Users\91808\anaconda3\lib\site-packages\numpy\lib\npyio.py", line 981, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "C:\Users\91808\anaconda3\lib\site-packages\numpy\lib\_datasource.py", line 269, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "C:\Users\91808\anaconda3\lib\site-packages\numpy\lib\_datasource.py", line 623, in open raise IOError("%s not found." % path)OSError: football.txt not found.present working directory 'C:\\Users\\91808'using spyder(python 3.8)
the question doesn't specify for each player so shouldn't it be mean of home goals - np.mean(L[:,0]) and mean of goals away - np.mean(L[:,1])llly for std?
how to installed NumPy?steps
TypeError Traceback (most recent call last)<ipython-input-2-7027eda59818> in <module>----> 1 L = np.loadtxt("student_record.txt",usecols=(3,4,5,6,7), delimeter=';')TypeError: loadtxt() got an unexpected keyword argument 'delimeter'
sudo Command is not recognized as internal or external command in windowsHow to install numpy
In [50]: L=loadtxt("C:\Users\Monish Naware\Desktop\Archana\Python\football.txt",usecols=(1,2),delimiter=',') File "<ipython-input-50-5d5ba460b8bf>", line 1 L=loadtxt("C:\Users\Monish Naware\Desktop\Archana\Python\football.txt",usecols=(1,2),delimiter=',') ^SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
while calculating mean of marks of students using math formula as well as mean function, my answer is 35.4.but for both cases answer in tutorial is 35.999999999999...Why precesion changes? is there any mean to set precesion of the numbers?
np.mean(L,0) it will calculate the mean along the columns. Instead of doing that, i was executed in two different lines by taking np.mean(L[0]) and np.mean(L[1]) then the expected output is as similar as the former one. but i am getting different results in both the scenarios. it was the same scenario for standard deviation also. What are the possible reasons for it??
In the previous tutorial we learned to use loadtxt() function without any library reference, here we numpy.loadtxt(). What is the difference?
usecols is not defined error
15989 visits
Outline:Statistical operations in Python Installation of Numpy for mathematical and logical operations Installation of pip to install python libraries loadtxt() function with example Getting the shape of an array Getting the sum of a column in an array How to calculate mean? Calculate mean across each of the axis of the array How to calculate median? How to calculate standard deviation?
Statistical operations in Python Installation of Numpy for mathematical and logical operations Installation of pip to install python libraries loadtxt() function with example Getting the shape of an array Getting the sum of a column in an array How to calculate mean? Calculate mean across each of the axis of the array How to calculate median? How to calculate standard deviation?
Show video info
Pre-requisite