_Python_Guide/8.18/contents.html
> is more up-to-date and we are on github too:
> https://github.com/DiamondLightSource
>
> Peter
>
>
> On 9 December 2011 13:05, Vicente Sole wrote:
>> Quoting Robert Kern :
>>
>>> On Fri, Dec 9, 2011 at 11:00, Yang Zhang wrote:
&
Quoting Robert Kern :
> On Fri, Dec 9, 2011 at 11:00, Yang Zhang wrote:
>
>> Thanks for the clarification. Alas. So is there no simple workaround
>> to making numpy work in environments such as Jepp?
>
> I don't think so, no.
>
It is far from being an optimal solution (in fact I dislike it) bu
Hi,
I have never seen myself a NetCDF file but if your NetCDF file is
using HDF5 as format (possible since NetCDF 4 if I am not mistaken),
you should be able to use h5py or PyTables to access and or modify it.
Best regards,
Armando
Quoting Chao YUE :
> Dear all,
>
> I want to change some v
Quoting josef.p...@gmail.com:
> but the two options don't produce the same result in general, the
> cumsum version doesn't restart from zero, I think
>
> try
> x0 = np.random.randint(5,size=30).cumsum()
> with delta=3
>
> I don't see a way around recursive looping
>
The x0 data are already sorted
.
Armando
Quoting Vicente Sole :
>>> ? Well a loop or list comparison seems like a good choice to me. It is
>>> much more obvious at the expense of two LOCs. Did you profile the two
>>> possibilities and are they actually performance-critical?
>>>
>>> che
>> ? Well a loop or list comparison seems like a good choice to me. It is
>> much more obvious at the expense of two LOCs. Did you profile the two
>> possibilities and are they actually performance-critical?
>>
>> cheers
>>
The second is between 8 and ten times faster on my machine.
import numpy
Correct. I thought just multiplying by -1 and inverting the logical
condition would give me the same output.
This makes exactly what I want:
>>> x= numpy.arange(10.)
>>> delta=3
>>> y=[x[0]]
>>> for value in x:
> ... if (value-y[-1]) < delta:
> ...y.append(value)
> ...
>>> y
[0., 4.
With A and X being arrays:
B=numpy.zeros(A.shape, A.dtype)
B[A>0] = X
Armando
Quoting gerardob :
>
> Let A be a square matrix of 0's and 1's, and let X be a one dimesional
> vector.
> The length of X is equal to the number of 1's that A has.
> I would like to produce a new matrix B by traversi
Quoting Bruce Southey :
> On 01/18/2010 12:47 PM, Vicente Sole wrote:
>> Quoting Bruce Southey :
>>
>>>
>>> If you obtain the code from any package then you are bound by the terms
>>> of that code. So while a user might not be 'inconvenienced'