Why I am getting this error to open the file?https://drive.google.com/file/d/1nLx3Vx90CqHOgEmQzgG0SLdVypvRLt3P/view?usp=sharingI am stuck in this problem but you haven't answered from many days.
In [3]: year, profit = loadtxt("/Users/91739/company-a-data.txt", dtype=type(int()))---------------------------------------------------------------------------ValueError Traceback (most recent call last)Input In [3], in <module>----> 1 year, profit = loadtxt("/Users/91739/company-a-data.txt", dtype=type(int()))ValueError: too many values to unpack (expected 2)
WHY WE USE DOUBLE MULTIPLY SIGN ** AND WHEN IN IPYTHON3
when we use ' ' and " " in ipython3 why
Dear Sir/Madam,If we use 'b' symbol for blue what is the symbol we use foe brown,black etcother than uing the symbols can we use the complete word with single quote
why is the answer false? is color="b" and color = "blue" different things?
How the change the shape of markers in scatter plot.
Sir/MamThe graph is a straight line due to non linear scaling.What does it really mean? I can't understand it.
not able to execute cat command and loadtxt. I hadsame issue in basic video 8(loading dat from file).In [45]: %pylabUsing matplotlib backend: TkAggPopulating the interactive namespace from numpy and matplotlibIn [46]: cat company-a-dat.txt File "<ipython-input-46-e95588f4945f>", line 1 cat company-a-dat.txt ^SyntaxError: invalid syntaxIn [47]: cat company-a-data.txt File "<ipython-input-47-37dbbe0090a4>", line 1 cat company-a-data.txt ^SyntaxError: invalid syntaxIn [48]: cat company-a-data.txt File "<ipython-input-48-37dbbe0090a4>", line 1 cat company-a-data.txt ^SyntaxError: invalid syntaxIn [49]: cat company-a-data.txt File "<ipython-input-49-37dbbe0090a4>", line 1 cat company-a-data.txt ^SyntaxError: invalid syntaxIn [50]: year,profit=loadtxt('company-a-dat.txt) File "<ipython-input-50-6c82ded6f088>", line 1 year,profit=loadtxt('company-a-dat.txt) ^SyntaxError: EOL while scanning string literalIn [51]: year,profit=loadtxt('company-a-dat.txt')---------------------------------------------------------------------------OSError Traceback (most recent call last)<ipython-input-51-9d4241c7c624> in <module>----> 1 year,profit=loadtxt('company-a-dat.txt')c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows) 979 fname = os_fspath(fname) 980 if _is_string_like(fname):--> 981 fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) 982 fencoding = getattr(fh, 'encoding', 'latin1') 983 fh = iter(fh)c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\_datasource.py in open(path, mode, destpath, encoding, newline) 267 268 ds = DataSource(destpath)--> 269 return ds.open(path, mode, encoding=encoding, newline=newline) 270 271c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\_datasource.py in open(self, path, mode, encoding, newline) 621 encoding=encoding, newline=newline) 622 else:--> 623 raise IOError("%s not found." % path) 624 625OSError: company-a-dat.txt not found.In [52]: year,profit=loadtxt('company-a-data.txt')---------------------------------------------------------------------------OSError Traceback (most recent call last)<ipython-input-52-b48e6119614d> in <module>----> 1 year,profit=loadtxt('company-a-data.txt')c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows) 979 fname = os_fspath(fname) 980 if _is_string_like(fname):--> 981 fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) 982 fencoding = getattr(fh, 'encoding', 'latin1') 983 fh = iter(fh)c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\_datasource.py in open(path, mode, destpath, encoding, newline) 267 268 ds = DataSource(destpath)--> 269 return ds.open(path, mode, encoding=encoding, newline=newline) 270 271c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\_datasource.py in open(self, path, mode, encoding, newline) 621 encoding=encoding, newline=newline) 622 else:--> 623 raise IOError("%s not found." % path) 624 625OSError: company-a-data.txt not found.In [53]: year,profit=loadtxt('company-a-data.txt',unpack=true)---------------------------------------------------------------------------NameError Traceback (most recent call last)<ipython-input-53-de6020824536> in <module>----> 1 year,profit=loadtxt('company-a-data.txt',unpack=true)NameError: name 'true' is not definedIn [54]: year,profit=loadtxt('company-a-data.txt',unpack=True)---------------------------------------------------------------------------OSError Traceback (most recent call last)<ipython-input-54-070812f8b62f> in <module>----> 1 year,profit=loadtxt('company-a-data.txt',unpack=True)c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows) 979 fname = os_fspath(fname) 980 if _is_string_like(fname):--> 981 fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) 982 fencoding = getattr(fh, 'encoding', 'latin1') 983 fh = iter(fh)c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\_datasource.py in open(path, mode, destpath, encoding, newline) 267 268 ds = DataSource(destpath)--> 269 return ds.open(path, mode, encoding=encoding, newline=newline) 270 271c:\users\admin\appdata\local\programs\python\python36\lib\site-packages\numpy\lib\_datasource.py in open(self, path, mode, encoding, newline) 621 encoding=encoding, newline=newline) 622 else:--> 623 raise IOError("%s not found." % path) 624 625OSError: company-a-data.txt not found.In [55]:
Dear AllI am getting errorn[13]: bar(year,profit)Out[13]: <BarContainer object of 11 artists>kindly help.thanks
Dear Allwhile using following command i get error,kindly help,..moreover in python for beginners,video of loading data from files is missing..kindly share In [5]: cat /Users/Gagan/Desktop/company-a-data.txt---------------------------------------------------------------------------NameError Traceback (most recent call last)<ipython-input-5-6df361578c72> in <module>----> 1 cat /Users/Gagan/Desktop/company-a-data.txtNameError: name 'cat' is not defined
I used scatter and plot command as per the exercise given. i plotted them in subplot to have comparison for the given data x=linspace(1,20,100) and y=5x3. I am getting exactly same plot. while in tutorial answer says 'NO'. why this is so?
25781 visits
Outline:scatter plot scatter function scatter plot with various arguments logarithmic plot loglog function cat command loadtxt function unpack parameter of loadtxt linspace scatter versus plot
scatter plot scatter function scatter plot with various arguments logarithmic plot loglog function cat command loadtxt function unpack parameter of loadtxt linspace scatter versus plot
Show video info
Pre-requisite