How to perform classification and clustering on a dataset which having numerical as well as text value as a feature presents

2017-07-21 Thread Vinayak Choubey
Hi All, I start learning python and enjoying very much.Right now i am trying to learn and use all machine learning things using python libraries.I stuck to a clustering and classification scenario.As i am a newbie in this,Seeking help with python code.I am explaining below: I am having dataset

Re: pyserial and end-of-line specification

2017-07-21 Thread FS
Thanks Rob. Yes I ended up with a read(1) and use a field count and a few other checks to make sure I don't get a partial record. Serial is the "best of times and worst of times". Sure beats dealing with USB enumeration, power hungry ethernet processors and a lot of other stuff. I can still "s

Re: JSON encoding PDF or Excel files in Python 2.7

2017-07-21 Thread Skip Montanaro
> JSON supports floats, ints, (Unicode) strings, lists and dicts (with string > keys). It doesn't support bytestrings (raw bytes). Thanks, MRAB and Irmen. It looks like bson does what I need. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: JSON encoding PDF or Excel files in Python 2.7

2017-07-21 Thread MRAB
On 2017-07-21 19:52, Skip Montanaro wrote: I would like to JSON encode some PDF and Excel files. I can read the content: pdf = open("somefile.pdf", "rb").read() but now what? json.dumps() insists on treating it as a string to be interpreted as utf-8, and bytes == str in Python 2.x. I can't jso

Re: JSON encoding PDF or Excel files in Python 2.7

2017-07-21 Thread Irmen de Jong
On 21/07/2017 20:52, Skip Montanaro wrote: > I would like to JSON encode some PDF and Excel files. I can read the content: > > pdf = open("somefile.pdf", "rb").read() > > but now what? json.dumps() insists on treating it as a string to be > interpreted as utf-8, and bytes == str in Python 2.x. I

JSON encoding PDF or Excel files in Python 2.7

2017-07-21 Thread Skip Montanaro
I would like to JSON encode some PDF and Excel files. I can read the content: pdf = open("somefile.pdf", "rb").read() but now what? json.dumps() insists on treating it as a string to be interpreted as utf-8, and bytes == str in Python 2.x. I can't json.dumps() a bytearray. I can pickle the raw c

Creating an oval inside a pyplot in Tkinter window

2017-07-21 Thread Tafla Magnaw
I spent about a week solving the problem I have in this code but I couldn't do anything. I just give up working due to that line of code. What I need is that: I have a main window with an "oval menu bar" and under the menu-bar, there is a " Add Oval" drop-down menu. when I click

Re: Where is python and idle?

2017-07-21 Thread Chris Angelico
On Sat, Jul 22, 2017 at 12:24 AM, Brian Case wrote: > I am running windows 10 version 1703 as administrator on a Dell Inspiron 15 > laptop. > > I downloaded and installed python 3.6.2 from > https://www.python.org/downloads/ for windows. > > https://www.programiz.com/python-programming instructs

Re: Where is python and idle?

2017-07-21 Thread Brian Case
Thank you, That is where it is. Would not have found it without your help. Now, to find IDLE. rgrds, Brian On 7/21/2017 10:19 AM, Nathan Ernst wrote: Check your user folder. For me, on my PC, python is installed at C:\Users\nernst\AppData\Local\Programs\Python Regards, Nate On Fri, Jul 2

Re: Where is python and idle?

2017-07-21 Thread Igor Korot
Hi, On Fri, Jul 21, 2017 at 11:19 AM, Nathan Ernst wrote: > Check your user folder. For me, on my PC, python is installed > at C:\Users\nernst\AppData\Local\Programs\Python I don't know about python, but usually a good Windows installer ask for the place to install and give some default path the

Re: Where is python and idle?

2017-07-21 Thread Nathan Ernst
Check your user folder. For me, on my PC, python is installed at C:\Users\nernst\AppData\Local\Programs\Python Regards, Nate On Fri, Jul 21, 2017 at 9:24 AM, Brian Case wrote: > I am running windows 10 version 1703 as administrator on a Dell Inspiron > 15 laptop. > > I downloaded and installed

Where is python and idle?

2017-07-21 Thread Brian Case
I am running windows 10 version 1703 as administrator on a Dell Inspiron 15 laptop. I downloaded and installed python 3.6.2 from https://www.python.org/downloads/ for windows. https://www.programiz.com/python-programming instructs me to open IDLE once that install completed. But I find NE

Re: Your feedback on our free Advanced Python tutorial

2017-07-21 Thread Mario R. Osorio
It would be nice if you made it more 'readable' the light gray foreground color of the text makes it very uncomfortable to read, at least to me. Take a look at: HOW THE WEB BECAME UNREADABLE https://www.wired.com/2016/10/how-the-web-became-unreadable/ -- https://mail.python.org/mailman/listinfo

Re: Grapheme clusters, a.k.a.real characters

2017-07-21 Thread Steve D'Aprano
On Fri, 21 Jul 2017 06:05 pm, Chris Angelico wrote: >> But emoji sequences will often require four code points, three of which will >> be in the supplementary planes. >> >> http://unicode.org/emoji/charts/emoji-zwj-sequences.html > > "Often"? I doubt that; a lot of emoji don't require that many.

Re: Not cathing nested StopIteration

2017-07-21 Thread Antoon Pardon
Thanks Peter and Chris for helping to resolve the knot in my brain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Not cathing nested StopIteration

2017-07-21 Thread Peter Otten
Antoon Pardon wrote: > This is python 3.4 on a debian box > > In the code below, line 36 raises a StopIteration, I would have > thought that this exception would be caught by line 39 but instead > I get a traceback. > > Did I miss something or is this a bug? Your code structure is try: rai

Re: Not cathing nested StopIteration

2017-07-21 Thread Chris Angelico
On Fri, Jul 21, 2017 at 6:32 PM, Antoon Pardon wrote: > This is python 3.4 on a debian box > > In the code below, line 36 raises a StopIteration, I would have > thought that this exception would be caught by line 39 but instead > I get a traceback. > > Did I miss something or is this a bug? > > Th

Not cathing nested StopIteration

2017-07-21 Thread Antoon Pardon
This is python 3.4 on a debian box In the code below, line 36 raises a StopIteration, I would have thought that this exception would be caught by line 39 but instead I get a traceback. Did I miss something or is this a bug? This is the code: try:

Re: Grapheme clusters, a.k.a.real characters

2017-07-21 Thread Chris Angelico
On Fri, Jul 21, 2017 at 4:34 PM, Steve D'Aprano wrote: > On Fri, 21 Jul 2017 01:43 pm, Chris Angelico wrote: > >> Strings with all code >> points on the BMP and no combining characters are still able to be >> represented as they are today, again with the empty secondary array. > > I presume that s

Re: Grapheme clusters, a.k.a.real characters

2017-07-21 Thread Steve D'Aprano
On Fri, 21 Jul 2017 01:43 pm, Chris Angelico wrote: > Strings with all code > points on the BMP and no combining characters are still able to be > represented as they are today, again with the empty secondary array. I presume that since the problem we're trying to solve here is that certain chara