kmeans clustering

2019-09-15 Thread Sharan Basappa
Can someone please help me to clarify the different between fit and predict functions of kmeans? -- https://mail.python.org/mailman/listinfo/python-list

Re: itertools product(infinite iterator) hangs

2019-09-15 Thread Oscar Benjamin
On Sat, 14 Sep 2019 at 07:22, ast wrote: > > Le 14/09/2019 à 04:26, Oscar Benjamin a écrit : > > > > What am I missing? > > here is a pseudo code for product: > > def product(*args, repeat=1): > # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy > # product(range(2), repeat=3) --> 000 0

Re: itertools product(infinite iterator) hangs

2019-09-15 Thread Oscar Benjamin
On Sat, 14 Sep 2019 at 03:26, Oscar Benjamin wrote: > > I've been staring at this for a little while: > > from itertools import product > > class Naturals: > def __iter__(self): > i = 1 > while True: > yield i > i += 1 > > N = Naturals() > print(iter(N))

``pipenv + pycharm'' refrash/rescan packages index without restart pycharm.

2019-09-15 Thread Hongyi Zhao
Hi, I use pycharm with pipenv for env management. When I do some changes on the packages, say, add/remove some of them. How to let pycharm efrash/ rescan packages index without restart it? -- https://mail.python.org/mailman/listinfo/python-list

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Morten W. Petersen
goto main; Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx søn. 15. sep. 2019, 03.07 skrev Christian Seberino : > Python is my goto main language. However, sometimes I'm tempted to > play with a Lisp like language just for

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Michael Torrie
On 9/15/19 9:10 AM, Christian Seberino wrote: > Say if I may ask a tangential question...I've always wondered whether it > would be not too hard to compile Python source code to a Lisp like source > code? How hard would it be to say compile Python source to Clojure source? I'm sure a compiler c

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-15 Thread Peter J. Holzer
On 2019-09-14 08:10:50 -0500, Spencer Graves wrote: >   As I'm thinking about it, the companies that provide cybersecurity > insurance could be the best points of leverage for this, because they think > about these kinds of things all the time. Insurance companies for decades I wouldn't set my

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-15 Thread Spencer Graves
On 2019-09-14 07:30, Gene Heskett wrote: On Saturday 14 September 2019 04:37:14 Larry Martell wrote: On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro wrote: https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has -35-million-lines-of-python-code-and-wont-be-updated-to-python-3-i

Re: # type: a

2019-09-15 Thread MRAB
On 2019-09-15 15:45, Hongyi Zhao wrote: Hi, In pycharm, when I commented out the following line: # type: a The pycharm still told me that: Unresolved reference 'a' Till I commented like the following, the warning will disappear: # type: # a Why? PyCharm has comment-based type hints, and

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Luciano Ramalho
Take a look at this, Christian: https://github.com/lihaoyi/macropy Best, Luciano On Sun, Sep 15, 2019 at 12:17 PM Christian Seberino wrote: > > > > I had to read this twice. It confused the hell out of me. > > Lol. Certainly didn't mean to be confusing! Hy bring Lisp to Python. I was > mor

Re: # type: a

2019-09-15 Thread Chris Warrick
On Sun, 15 Sep 2019 at 16:53, Hongyi Zhao wrote: > > Hi, > > In pycharm, when I commented out the following line: > > # type: a > > The pycharm still told me that: > > Unresolved reference 'a' PyCharm interprets PEP 484 type annotations and type comments, as well as PEP 526 variable annotations.

Re: # type: a

2019-09-15 Thread אורי
Try to wait a few minutes, or close and re-open PyCharm. If the problem persists, send a screenshot. אורי u...@speedy.net On Sun, Sep 15, 2019 at 5:51 PM Hongyi Zhao wrote: > Hi, > > In pycharm, when I commented out the following line: > > # type: a > > The pycharm still told me that: > > Unre

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Christian Seberino
> Python vs Clojure's syntax difference is superficial compared to their > other differences, like the Clojure's immutable data structures and > having to deal with the JVM. Well there's ClojureScript to run this hypothetical Pythonic Lisp in the browser. > I also don't think it's really practic

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Christian Seberino
> I had to read this twice. It confused the hell out of me. Lol. Certainly didn't mean to be confusing! Hy bring Lisp to Python. I was more interested in making a Lisp that had trivial similarities to Python like using some of the same keywords. A related interested of mine is converting P

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Michael Torrie
On 9/14/19 8:19 PM, Louis Valence wrote: > I had to read this twice. It confused the hell out of me. Anyhow, I > suppose you should take a look at > > https://github.com/hylang/hy Yup that's probably exactly the opposite of what the OP was asking about. Neat, though. -- https://mail.pytho

# type: a

2019-09-15 Thread Hongyi Zhao
Hi, In pycharm, when I commented out the following line: # type: a The pycharm still told me that: Unresolved reference 'a' Till I commented like the following, the warning will disappear: # type: # a Why? -- https://mail.python.org/mailman/listinfo/python-list

Re: what's the differences: None and null?

2019-09-15 Thread ast
Le 14/09/2019 à 03:40, Random832 a écrit : On Fri, Sep 13, 2019, at 21:22, Hongyi Zhao wrote: what's the differences: None and null? null isn't really a concept that exists in Python... while None fills many of the same roles that null does in some other languages, it is a proper object, wit

Re: Bool variable with json.dumps

2019-09-15 Thread Hongyi Zhao
On Sun, 15 Sep 2019 19:36:20 +1000, Cameron Simpson wrote: > Because that's how the true value is spelt in JavaScript. You _are_ > aware that JSON is "JavaScript Object Notation", are you not? So > json.dumps translates Python values into JavaScript syntax. > > This is likely to be the same reaso

Re: Bool variable with json.dumps

2019-09-15 Thread Cameron Simpson
On 15Sep2019 09:15, Hongyi Zhao wrote: var = True when json.dumps on it, it will become the form `true' Why? Because that's how the true value is spelt in JavaScript. You _are_ aware that JSON is "JavaScript Object Notation", are you not? So json.dumps translates Python values into JavaScr

Bool variable with json.dumps

2019-09-15 Thread Hongyi Zhao
Hi, var = True when json.dumps on it, it will become the form `true' Why? -- https://mail.python.org/mailman/listinfo/python-list

Re: what's the differences: None and null?

2019-09-15 Thread Andrea D'Amore
On Sat, 14 Sep 2019 at 03:40, Random832 wrote: > On Fri, Sep 13, 2019, at 21:22, Hongyi Zhao wrote: > > what's the differences: None and null? > null isn't really a concept that exists in Python... I'd say the opposite, according to [1] "None" is just the name of the null object. [1]: https://