Re: Regular expression

2017-07-26 Thread Paul Barry
an anyone suggest me how should i proceed.? > > What have you tried? > > Why do you need regular expression? > > >>> s = 'first-324-True-rms-kjhg-Meterc639.html' > > >>> s[-4:] > 'html' > > Regards > Johann > -- > Because

Re: Combining 2 data series into one

2017-06-28 Thread Paul Barry
Maybe look at using .concat instead of + See: http://nbviewer.jupyter.org/github/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.06-Concat-And-Append.ipynb On 28 June 2017 at 13:02, Paul Barry wrote: > > Maybe try your code on a sub-set of your data - perhaps 1000 lines of

Re: Combining 2 data series into one

2017-06-28 Thread Paul Barry
On Wed, Jun 28, 2017 at 5:17 PM, Paul Barry > wrote: > >> On the line that's failing, your code is this: >> >> combinedX=combinedX+dframe['tf'] >> >> which uses combinedX on both sides of the assignment statement - note >> that Python is r

Re: Combining 2 data series into one

2017-06-28 Thread Paul Barry
ooks/03.07-Merge-and-Join.ipynb - this should take about 20 minutes to read, and may be of use to you. Paul. On 28 June 2017 at 12:19, Bhaskar Dhariyal wrote: > On Wednesday, 28 June 2017 14:43:48 UTC+5:30, Paul Barry wrote: > > This should do it: > > > > >>> impo

Re: Combining 2 data series into one

2017-06-28 Thread Paul Barry
2017 at 07:11, Bhaskar Dhariyal wrote: > Hi! > > I have 2 dataframe i.e. df1['first_name'] and df2['last_name']. I want to > make it as df['name']. How to do it using pandas dataframe. > > first_name > -- > bhaskar >

Re: A Good Tutorial on Python Decorators

2017-06-27 Thread Paul Barry
projects/py-decorators-tutorial > > > > "No Results found." > > > > -- > > To email me, substitute nowhere->runbox, invalid->com. > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > -- > https://mail

Fwd: Unable to convert pandas object to string

2017-06-25 Thread Paul Barry
Forgot to include this reply to the list (as others may want to comment). -- Forwarded message -- From: Paul Barry Date: 24 June 2017 at 12:21 Subject: Re: Unable to convert pandas object to string To: Bhaskar Dhariyal Note that .info(), according to its docs, gives you a

Re: Unable to convert pandas object to string

2017-06-24 Thread Paul Barry
google.com/file/d/0B1D4AyluMGU0enoxbElGTV94Q0E/view?usp=drive_web> > ​here it is thanks for quick reply > > On Sat, Jun 24, 2017 at 3:14 PM, Paul Barry > wrote: > >> Any chance you could post one line of data so we can see what we have to >> work with? >> >>

Re: Unable to convert pandas object to string

2017-06-24 Thread Paul Barry
help > -- > https://mail.python.org/mailman/listinfo/python-list > -- Paul Barry, t: @barrypj <https://twitter.com/barrypj> - w: http://paulbarry.itcarlow.ie - e: paul.ba...@itcarlow.ie Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland. -- https://mail.python.org/mailman/listinfo/python-list

Re: Instagram: 40% Py3 to 99% Py3 in 10 months

2017-06-16 Thread Paul Barry
rry Reedy > escreveu: > > > https://thenewstack.io/instagram-makes-smooth-move-python-3/ > > -- > > Terry Jan Reedy > > > > -- > > https://mail.python.org/mailman/listinfo/python-list > > > -- > https://mail.python.org/mailman/listinfo/python-list >

Re: Does Python need Javascript?

2017-06-15 Thread Paul Barry
Life is too short... 😉 On 15 Jun 2017 08:17, "Steven D'Aprano" wrote: Now that Java 8 includes a Javascript interpreter (Nashorn) as part of the JDK, and since Javascript is The Future™, does Python need a Javascript interpreter in the standard library? If Python came with a Javascript interpre

Re: data structure

2017-06-15 Thread Paul Barry
ct): > a = '' > b = '' > def __init__(self): > a= 'aa' > b= 'ab' > > class ClassB(object): > def __init__(self): > self.c = 'ba' > self.d = 'bb' > > def main(): > obja = ClassA > objb = ClassB > > sets = set(obja, objb) > contracts[1] = sets > > print('Sets ', contracts) > > # with the logic like ( not working too) > if obja.a = 'aa': > contracts[1].obja.a = 'ABC' > > > if __name__ == '__main__': > main() > > > ### code end > > appreciate your guidance > -- > https://mail.python.org/mailman/listinfo/python-list > -- Paul Barry, t: @barrypj <https://twitter.com/barrypj> - w: http://paulbarry.itcarlow.ie - e: paul.ba...@itcarlow.ie Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland. -- https://mail.python.org/mailman/listinfo/python-list

Re: Time Calculation to Tag a Sentence/File (Posting On Python-List Prohibited)

2017-06-09 Thread Paul Barry
th Java, so we try to work around Python2.x. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Paul Barry, t: @barrypj <https://twitter.com/barrypj> - w: http://paulbarry.itcarlow.ie - e: paul.ba...@itcarlow.ie Lecturer, Computer Networking: Institute of Technology, Carlow, Ireland. -- https://mail.python.org/mailman/listinfo/python-list

Re: plot time on X axis

2017-06-07 Thread Paul Barry
al > daily time seriee for several years. Please can someone help me. I would > like to plot on X axis only the values o the year. > > Thanks, > > Conrado > -- > https://mail.python.org/mailman/listinfo/python-list > -- Paul Barry, t: @barrypj <https://twitter.com/bar

Re: How to change variable from list to float

2017-06-05 Thread Paul Barry
1.2, -40.0, 0.4, -5.5, -1.5, -20.0, 0.9, > -3.5, -1.9, -15.0, -13.0, 1.3, -1.3, -3.6, -1.0, -1.1] > azlist = [float(i) for i in azlist] > closestaz = min(azlist, key=lambda x: abs(x - azdegpattrev)) > existattn = azattndic[closestaz] > siglevfromexist = 34.8 + existattn

Re: Is An Element of a Sequence an Object?

2017-06-05 Thread Paul Barry
t; ... > ... def __len__(self): > ... return 10 > >>> s = Squares() > >>> s[9] > 81 > > All 10 squares are generated on-the-fly (though all int objects already > exist due to the small int caching on CPython). > > -- > https://mail.

Re: Can't get UDP example to work

2009-07-26 Thread Paul Barry
On Jul 26, 11:07 am, MRAB wrote: > Paul Barry wrote: > > I'm trying to get one of the examples from Foundation of Python > > Network Programming to work.  Specifically this is the UDP example > > from Ch 3.  First there is the server: > > > #!/usr/bin/env pytho

Re: Can't get UDP example to work

2009-07-26 Thread Paul Barry
On Jul 26, 12:53 pm, Roy Smith wrote: > In article > <148abf0f-c9e4-4156-8f16-e4e5615d3...@s6g2000vbp.googlegroups.com>, >  Paul Barry wrote: > > > host = '127.0.0.1'           # Bind to all interfaces > > This threw me off the track for a little whil

Can't get UDP example to work

2009-07-26 Thread Paul Barry
I'm trying to get one of the examples from Foundation of Python Network Programming to work. Specifically this is the UDP example from Ch 3. First there is the server: #!/usr/bin/env python # UDP Echo Server - Chapter 3 - udpechoserver.py import socket, traceback, time host = '127.0.0.1'