Hi all,
My problem is this error: http://pastebin.com/bfu29WuF
my code: http://pastebin.com/KzwEmucN
What could be?
Thanks
Waleria
Hi all,
My problem is this error: http://pastebin.com/bfu29WuF
my code: http://pastebin.com/KzwEmucN
What could be?
Thanks
Waleria
Waleria,
I am not entirely familiar with programming python in a Windows environment, however, you are attempting to open files with the name: ‘C:\date1.dat’. The backslash is probably acting as an escape character and causing the filename to be interpreted differently from how you expect. Try this:
x, y, yerr = np.loadtxt(r’C:\date1.dat’, unpack=True)
The ‘r’ before the string forces python to not interpret any special characters in a special way. Also note that I simplified your data loading code with the use of the ‘unpack=True’ keyword argument.
I hope this helps,
Ben Root
On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <waleriantunes@…287…> wrote:
Hi all,
My problem is this error: http://pastebin.com/bfu29WuF
my code: http://pastebin.com/KzwEmucN
What could be?
Thanks
Waleria
Benjamin,
I tried this: x, y, yerr = np.loadtxt(r’C:\date1.dat’, unpack=True)
but the error continue: http://pastebin.com/UwgKS3s5
Thanks,
Waleria.
On Mon, Oct 4, 2010 at 4:58 PM, Benjamin Root <ben.root@…83…1304…> wrote:
On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <waleriantunes@…287…> wrote:
Hi all,
My problem is this error: http://pastebin.com/bfu29WuF
my code: http://pastebin.com/KzwEmucN
What could be?
Thanks
Waleria
Waleria,
I am not entirely familiar with programming python in a Windows environment, however, you are attempting to open files with the name: ‘C:\date1.dat’. The backslash is probably acting as an escape character and causing the filename to be interpreted differently from how you expect. Try this:
x, y, yerr = np.loadtxt(r’C:\date1.dat’, unpack=True)
The ‘r’ before the string forces python to not interpret any special characters in a special way. Also note that I simplified your data loading code with the use of the ‘unpack=True’ keyword argument.
I hope this helps,
Ben Root
Waleria,
Good! There is progress. The error indicates that the processing successfully loaded the data and that it fails when it tries to save the figure. Specifically, it is failing to produce the LaTeX-like labels you have made. Looking closer, I see that the carot symbol ‘^’ that you are using to get a superscript is a unicode carot symbol, not an ASCII one. This causes the formatting parsing to fail. You need to use the ASCII symbol ^ to make it work properly.
I hope that helps.
Ben Root
On Tue, Oct 5, 2010 at 7:25 AM, Waléria Antunes David <waleriantunes@…287…> wrote:
Benjamin,
I tried this: x, y, yerr = np.loadtxt(r’C:\date1.dat’, unpack=True)
but the error continue: http://pastebin.com/UwgKS3s5
Thanks,
Waleria.
On Mon, Oct 4, 2010 at 4:58 PM, Benjamin Root <ben.root@…1304…> wrote:
On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <waleriantunes@…287…> wrote:
Hi all,
My problem is this error: http://pastebin.com/bfu29WuF
my code: http://pastebin.com/KzwEmucN
What could be?
Thanks
Waleria
Benjamin,
You were right, the error was being cause because this ‘^’ … problem solved.
Thank you very much
On Tue, Oct 5, 2010 at 11:38 AM, Benjamin Root <ben.root@…1304…> wrote:
On Tue, Oct 5, 2010 at 7:25 AM, Waléria Antunes David <waleriantunes@…287…> wrote:
Benjamin,
I tried this: x, y, yerr = np.loadtxt(r’C:\date1.dat’, unpack=True)
but the error continue: http://pastebin.com/UwgKS3s5
Thanks,
Waleria.
On Mon, Oct 4, 2010 at 4:58 PM, Benjamin Root <ben.root@…1304…> wrote:
On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <waleriantunes@…287…> wrote:
Hi all,
My problem is this error: http://pastebin.com/bfu29WuF
my code: http://pastebin.com/KzwEmucN
What could be?
Thanks
Waleria
Waleria,
Good! There is progress. The error indicates that the processing successfully loaded the data and that it fails when it tries to save the figure. Specifically, it is failing to produce the LaTeX-like labels you have made. Looking closer, I see that the carot symbol ‘^’ that you are using to get a superscript is a unicode carot symbol, not an ASCII one. This causes the formatting parsing to fail. You need to use the ASCII symbol ^ to make it work properly.
I hope that helps.
Ben Root