Re: [Tutor] Reading in large .dat file

2016-06-29 Thread Colin Ross
On Wed, Jun 29, 2016 at 4:21 PM, Peter Otten <__pete...@web.de> wrote: > Colin Ross wrote: > > > On Wed, Jun 29, 2016 at 2:41 PM, Peter Otten <__pete...@web.de> wrote: > > > >> Colin Ross wrote: > >> > >> > Good afternoon, > >&

Re: [Tutor] Reading in large .dat file

2016-06-29 Thread Colin Ross
On Wed, Jun 29, 2016 at 2:41 PM, Peter Otten <__pete...@web.de> wrote: > Colin Ross wrote: > > > Good afternoon, > > > > I have a .dat file that is 214 rows by 65 columns that I would like to > > read into python and plot the 1st column versu

[Tutor] Reading in large .dat file

2016-06-29 Thread Colin Ross
Good afternoon, I have a .dat file that is 214 rows by 65 columns that I would like to read into python and plot the 1st column versus all other columns. My code: # import numpy as np import scipy import pylab as pl import

Re: [Tutor] Extracting bits from an array

2016-04-29 Thread Colin Ross
Thank you Michael, this is exactly what I was looking for! Clears things up on multiple fronts : ) On Fri, Apr 29, 2016 at 2:29 PM, Michael Selik <michael.se...@gmail.com> wrote: > > > > On Apr 29, 2016, at 1:15 PM, Colin Ross <colin.ross@gmail.com> > wrote: &g

[Tutor] Extracting bits from an array

2016-04-29 Thread Colin Ross
Hello, I have an array that takes on the following form: x = [1000,1001,1011,] The array elements are meant to be binary representation of integers. Goal: Access array elements and extract the first two bits. e.g. Final result would look something like this: x_new = [10,10,10,11] What I

[Tutor] how to define constant width errorbars on log-log plot

2015-08-06 Thread Colin Ross
Does anyone have an example code that shows how to plot errorbars with a constant line width for a dataset on a log log plot? Thank you. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] Plotting asymmetric error bars for a single point in matplotlib

2015-08-04 Thread Colin Ross
Hi all, Goal: To plot asymmetric x error bars for a single point using errorbar. I am interested in displaying the inter quartile range (IQR) for a data set. Code: import numpy as np import matplotlib.pyplot as plt y = 1.0 data = np.random.rand(100) median = np.median(data) upper_quartile =

Re: [Tutor] Shading Between Curves with Different Colour Over Specified X value Range

2015-07-29 Thread Colin Ross
On Tue, Jul 28, 2015 at 11:03 AM, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On Mon, 27 Jul 2015 at 20:53 Colin Ross colin.ross@gmail.com wrote: *Goal:* Shade between I_2 (curve 1) and I_3 (curve 2) with following conditions: - Green

[Tutor] Arrow of constant size on log plot

2015-07-29 Thread Colin Ross
I am attempting to draw an arrow that begins at a specified point on a logarithmic plot and then extends a certain distance in the -Y direction. This part is fine, however I would like to draw multiple arrows with the same size corresponding to different points on a plot. If I specify a certain

Re: [Tutor] Shading Between Curves with Different Colour Over Specified X value Range

2015-07-28 Thread Colin Ross
On Mon, Jul 27, 2015 at 5:01 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 27/07/2015 19:47, Colin Ross wrote: *Goal:* Shade between I_2 (curve 1) and I_3 (curve 2) with following conditions: - Green for 0 x 4

[Tutor] Shading Between Curves with Different Colour Over Specified X value Range

2015-07-27 Thread Colin Ross
*Goal:* Shade between I_2 (curve 1) and I_3 (curve 2) with following conditions: - Green for 0 x 4 - Red for 4 x 12 *Code: * *Note: Code currently only attempting to shade green for 0 x 4 * import

[Tutor] Python serial interface

2015-04-01 Thread Colin Ross
Hi all, This is a very general question, but I was wondering if anyone has experience using python to interface with a serial port? If so, can you please forward any useful resources? Thanks! Colin ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Python serial interface

2015-04-01 Thread Colin Ross
I am using the following controller: http://www.aerotech.com/product-catalog/drives-and-drive-racks/ensemble-mp.aspx Which does not specifically list python as one of the accepted languages, but I guess this does not mean it is not possible. Colin On Wed, Apr 1, 2015 at 12:58 PM, Colin Ross

Re: [Tutor] Python serial interface

2015-04-01 Thread Colin Ross
Hi Francois, Thank you for the fast reply! I am looking to control a brushless servo motor ( http://www.aerotech.com/product-catalog/motors/rotary-motors/bms-series.aspx) that drives a rotary stage. Colin On Wed, Apr 1, 2015 at 11:53 AM, Francois Dion francois.d...@gmail.com wrote: Pyserial

Re: [Tutor] Python serial interface

2015-04-01 Thread Colin Ross
Thank you Francois, this gives me a lot to think about! I really appreciate your feedback. Colin On Wed, Apr 1, 2015 at 12:50 PM, Francois Dion francois.d...@gmail.com wrote: On Wed, Apr 1, 2015 at 11:01 AM, Colin Ross colin.ross@gmail.com wrote: Hi Francois, Thank you for the fast

Re: [Tutor] Fitting data to error function

2015-03-16 Thread Colin Ross
, Mar 16, 2015 at 6:50 PM, Colin Ross colin.ross@gmail.com wrote: HI Danny, Here is a simplified version: import numpy as np import pylab from pylab import * import matplotlib.pyplot as plt import scipy from

Re: [Tutor] Fitting data to error function

2015-03-16 Thread Colin Ross
Yes, thank you, they were suppose to both be E_out. And to answer your last question, I do not. Can you please explain? On Mon, Mar 16, 2015 at 7:19 PM, Danny Yoo d...@hashcollision.org wrote: On Mon, Mar 16, 2015 at 2:55 PM, Colin Ross colin.ross@gmail.com wrote: What I am trying

Re: [Tutor] Fitting data to error function

2015-03-16 Thread Colin Ross
HI Danny, Here is a simplified version: import numpy as np import pylab from pylab import * import matplotlib.pyplot as plt import scipy from scipy.integrate import quad from scipy.fftpack import fft, ifft, fftfreq

Re: [Tutor] Fitting data to error function

2015-03-15 Thread Colin Ross
Hi Danny, Thanks for the help! As you mentioned, using scipy.special.erfc was a much better idea. Below is a copy of my program and the stack trace, showing a new error. It seems that the first auto correlation works, however the second fails. ### # Autocorrelation

[Tutor] Fitting data to error function

2015-03-13 Thread Colin Ross
Hi all, I am attempting to optimize the parameters I_0 and w_0 in the function (func(x,I_0,w_0) shown below) to fit a set of data. However when I run this code I recieve the error shown below. Any suggestions would be greatly appreciated. Code: import numpy as np import math from math import

[Tutor] selecting data from a list

2015-01-17 Thread Colin Ross
Hi all, I am attempting to isolate a certain subset of data from the list a and then turn it into any array. To do so, I have written the following code: import numpy as np a = [0,1,2,3,4,5,6,7,8,9,10] b = [10,20,30,40,50,60,70,80,90,100,110] for a in range(len(a)): if a 5: print a a_1 =

[Tutor] Plotting subsets of data

2014-12-08 Thread Colin Ross
Good afternoon, I am using the following to code to plot the output from an optical encoder: import numpy as np from numpy import ma, logical_or import pylab from pylab import * import matplotlib.pyplot as plt from matplotlib.ticker import AutoMinorLocator import sys # Defining x and y

Re: [Tutor] Plotting subsets of data

2014-12-08 Thread Colin Ross
Perfect, thank you Danny! On Mon, Dec 8, 2014 at 3:49 PM, Danny Yoo d...@hashcollision.org wrote: On Mon, Dec 8, 2014 at 7:48 AM, Colin Ross colin.ross@gmail.com wrote: Good afternoon, I am using the following to code to plot the output from an optical encoder: Hi Colin

[Tutor] Error message received when running “from scipy import interpolate”

2014-06-05 Thread Colin Ross
I am attempting to run the following in python: from scipy import interpolate I receive this error message: Traceback (most recent call last): File stdin, line 1, in module File