Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-11 Thread Chris Angelico
On Thu, Apr 12, 2018 at 2:16 PM, wrote: > This C function returns a buffer which I declared it as a ctypes.c_char_p. > The buffer has size 0x1 bytes long and the valid data may vary from a few > bytes to the whole size. > > In every call I know how much the valid data size is, but I suppose

How to write partial of a buffer which was returned from a C function to a file?

2018-04-11 Thread jfong
This C function returns a buffer which I declared it as a ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid data may vary from a few bytes to the whole size. In every call I know how much the valid data size is, but I suppose I can't use slice to get it because there may be

Re: Compression of random binary data

2018-04-11 Thread cuddlycaveman
I’m replying to your post on January 28th Nice carefully chosen non random numbers Steven D'Aprano. Was just doing what you asked, but you don’t remember 😂😂😂 -- https://mail.python.org/mailman/listinfo/python-list

Re: Filtering computer.lang.python

2018-04-11 Thread Skip Montanaro
> I fetch comp.lang.python from eternal.september with leafnode, and after > 30 years of Usenet I recently had to install a news filter to remove the > garbage. After the initial flurry the filter doesn't need much updating, > but here's why it's necessary: ... > for totals of 2168 fetched and 438

Re: Filtering computer.lang.python

2018-04-11 Thread Mark Lawrence
On 10/04/18 21:06, C W Rose via Python-list wrote: Thomas Jollans wrote: Welcome to python-list/comp.lang.python! This isn't originally a Google group. Google just mirrors the old USENET group, which is awash with spam. There is also a mailing list version of this group (posts are mirrored b

Re: beacons and geofences

2018-04-11 Thread ElChino
Rafal Sikora wrote: Hi! I want users’ devices to be able to monitor the maximum amount of POIs at once (geo-fences/beacons) and I need to prepare an algorithm solution for > monitoring the POIs. How should it be implemented in Python? What? You'll have to describe the problem in more details

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread Albert-Jan Roskam
On Apr 11, 2018 20:52, zljubi...@gmail.com wrote: > > I have a dataframe: > > import pandas as pd > import numpy as np > > df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B' : [None, np.nan, 'a', 'b', '']}) > > A B > 0 a None > 1 b NaN > 2

Re: [OT] multicore/cpu history

2018-04-11 Thread Grant Edwards
On 2018-03-25, Steven D'Aprano wrote: > Not really. With multiple CPUs, you have the option of running two > distinct OSes in isolation, not merely virtual machines but actual > distinct machines in the same box. Not on any of the multi-CPU motherboards I ever worked with. The CPUs shared SDR

Re: [OT] multicore/cpu history

2018-04-11 Thread Peter J. Holzer
On 2018-03-25 22:52:59 +, Steven D'Aprano wrote: > On Sun, 25 Mar 2018 23:29:07 +0200, Peter J. Holzer wrote: > >> >> By the way, multiple CPU machines are different from CPUs with > >> >> multiple cores: > >> >> > >> >> http://smallbusiness.chron.com/multiple-cpu-vs-multicore-33195.html > >> >

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread codewizard
On Wednesday, April 11, 2018 at 2:49:01 PM UTC-4, zlju...@gmail.com wrote: > I have a dataframe: > > import pandas as pd > import numpy as np > > df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B' : [None, np.nan, 'a', 'b', '']}) > > A B > 0 a Non

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread José María Mateos
On Wed, Apr 11, 2018, at 14:48, zljubi...@gmail.com wrote: > I have a dataframe: > [...] This seems to work: df1 = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], 'B' : [None, np.nan, 'a', 'b', '']}) df1['C'] = df1[['A', 'B']].apply(lambda x

Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread zljubisic
I have a dataframe: import pandas as pd import numpy as np df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], 'B' : [None, np.nan, 'a', 'b', '']}) A B 0 a None 1 b NaN 2 a 3 None b 4 NaN I would like to create column C in

Re: Levenberg-Marquardt Algorithm

2018-04-11 Thread tejaswi prakash
I am sorry, but I thought Levenberg marquardt was used quite bit in Image registration. Computing/refining homographies between two related views for instance. On Wed, Apr 11, 2018 at 12:49 PM, Christian Gollwitzer wrote: > Am 11.04.18 um 08:38 schrieb Priya Singh: > >> I have two 2D arrays one

Re: Filtering computer.lang.python

2018-04-11 Thread C W Rose via Python-list
Thomas Jollans wrote: > > Welcome to python-list/comp.lang.python! > > This isn't originally a Google group. Google just mirrors the old USENET > group, which is awash with spam. > > There is also a mailing list version of this group (posts are mirrored > both ways) at https://mail.python.org/m

beacons and geofences

2018-04-11 Thread Rafal Sikora
Hi! I want users’ devices to be able to monitor the maximum amount of POIs at once (geo-fences/beacons) and I need to prepare an algorithm solution for monitoring the POIs. How should it be implemented in Python? -- https://mail.python.org/mailman/listinfo/python-list

Levenberg-Marquardt Algorithm

2018-04-11 Thread Priya Singh
Good morning. I need some suggestion from you if you have encountered this problem ever. I have two 2D arrays one R and another T (which is also a 2D array). Do you know how can I fit T with R in order to find central coordinate x0,y0 for T relative to R??? So the main question is do you know in

Re: Compression of random binary data

2018-04-11 Thread Steven D'Aprano
On Tue, 10 Apr 2018 23:36:27 -0700, cuddlycaveman wrote: [snip a number of carefully chosen, non-random numbers shown in binary] > Don’t know if that helps Helps what? With no context, we don't know who you are replying to, what they asked, or why you think this is helpful. According to my a

Re: ANN: PyDDF Python Spring Sprint 2018

2018-04-11 Thread Karsten Hilbert
> * mxDateTime Portierung auf Python 3.6 +1 !! Karsten Hilbert -- -- https://mail.python.org/mailman/listinfo/python-list

Re: Levenberg-Marquardt Algorithm

2018-04-11 Thread Christian Gollwitzer
Am 11.04.18 um 08:38 schrieb Priya Singh: I have two 2D arrays one R and another T (which is also a 2D array). Do you know how can I fit T with R in order to find central coordinate x0,y0 for T relative to R??? So the main question is do you know in python how can I fit two 2D arrays to find x0