hi sir, i was trying this and i amfacing thiserror please helpme year, profit = loadtxt('C:\Users\DDay\Downloads\Compressed\company-a-data.txt', unpack=True) File "<ipython-input-7-27db1e0fb82c>", line 1 year, profit = loadtxt('C:\Users\DDay\Downloads\Compressed\company-a-data.txt', unpack=True) ^SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
so much error while using 2nd command. I cant solve this issue
I am using virtual box for Ubuntu-Linux. And my spoken tutorial files are stored in windows os, so that's why I am not able to open a source code in ubuntu-linux. What should i do now? Each and every time I am facing this problem.
Dear Sir,I place of 'cat command' I am using' %pycat command' to fetch the data in Command Prompt.Is it correct?I am operating python in Windows 10 and while running the loadtxt command i am continuously getting erroryear,profit= loadtxt('C:\Users\Manisha\Desktop\Data code\company-a-data.txt',unpack=True) But I am getting error File "<ipython-input-58-097f699b5275>", line 1 year,profit= loadtxt('C:\Users\Manisha\Desktop\Data code\company-a-data.txt',unpack=True) ^SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escapePlease provide solution of this problem
company-a-data.txt file is mission, kindly provide the file...
Dear Sir/Madam,I'm using Linux Ubuntu.In Spoken Tutorial number 9 for Python, "Other types of plots", I'm receiving a ValueError after inserting input for loadtxt function. Firstly, I download the Code Files for this tutorial. "2-3/company-a-data.txt"Then enter first input as per shown:In [1]: cat /home/hamzak/2-3/company-a-data.txt2.000000000000000000e+03 2.001000000000000000e+03 2.002000000000000000e+03 2.003000000000000000e+03 2.004000000000000000e+03 2.005000000000000000e+03 2.006000000000000000e+03 2.007000000000000000e+03 2.008000000000000000e+03 2.009000000000000000e+03 2.010000000000000000e+032.300000000000000000e+01 5.500000000000000000e+01 3.200000000000000000e+01 6.500000000000000000e+01 8.800000000000000000e+01 5.000000000000000000e+00 1.400000000000000000e+01 6.700000000000000000e+01 2.300000000000000000e+01 2.300000000000000000e+01 1.200000000000000000e+01In [2]: year,profit = loadtxt('/home/hamzak/2-3/company-a-data.txt',dtype=type(int()))---------------------------------------------------------------------------ValueError Traceback (most recent call last)<ipython-input-2-651cfa2ff470> in <module>()----> 1 year,profit = loadtxt('/home/hamzak/2-3/company-a-data.txt',dtype=type(int()))/usr/lib/python2.7/dist-packages/numpy/lib/npyio.pyc\\\\r\\\\n in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, \\\\r\\\\nusecols, unpack, ndmin) 846 vals = [vals[i] for i in usecols] 847 # Convert each value according to its column and store--> 848 items = [conv(val) for (conv, val) in zip(converters, vals)] 849 # Then pack it according to the dtype's nesting 850 items = pack_items(items, packing)ValueError: invalid literal for long() with base 10: '2.000000000000000000e+03'I'm not sure why this is error is occurring, is there something wrong with the company-a-data.txt file?Please advice. Thank you.
7223 visits
Outline: Other types of plots scatter pie chart bar chart log illustration of other plots, matplotlib help
Other types of plots scatter pie chart bar chart log illustration of other plots, matplotlib help
Show video info
Pre-requisite