Humble Book Bundle: Python by Packt
One can purchase the following Python books and videos published by Packt for $15 at https://www.humblebundle.com/books/python-by-packt-book-bundle for about the next two weeks. Python Data Analysis Cookbook Mastering Python, Second Edition Learning Robotics using Python Python Programming with Raspberry Pi Web Development with Django Cookbook Expert Python Programming, Second Edition Learning Python Web Penetration Testing (Video) Python Data Science Essentials, Second Edition Learning Concurrency in Python Python Data Structures and Algorithms Beginning Python (Video) Building RESTful Python Web Services Mastering Python Networking Artificial Intelligence with Python Deep Learning with Python (Video) Python Machine Learning Projects (Video) Python Machine Learning Python Microservices Development Python Design Patterns (Video) Software Architecture with Python Modern Python Cookbook Python High Performance, Second Edition Python GUI Programming Cookbook, Second Edition Mastering Python (Video) -- https://mail.python.org/mailman/listinfo/python-list
Python library to break text into words
I bought some e-books in a Humble Bundle. The file names are shown below. I would like to hyphenate words within the file names, so that the first three titles are a_devils_chaplain.pdf atomic_accidents.pdf chaos_making_a_new_science.pdf Is there a Python library that uses intelligent guesses to break sequences of characters into words? The general strategy would be to break strings into the longest words possible. The library would need to "know" a sizable subset of words in English. adevilschaplain.pdf atomicaccidents.pdf chaos_makinganewscience.pdf dinosaurswithoutbones.pdf essaysinscience.pdf genius_thelifeandscienceofrichardfeynman.pdf louisagassiz_creatorofamericanscience.pdf martiansummer.pdf mind_aunifiedtheoryoflifeandintelligence.pdf noturningback.pdf onshakyground.pdf scienceandphilosophy.pdf sevenelementsthatchangedtheworld.pdf strangeangel.pdf theboywhoplayedwithfusion.pdf thecanon.pdf theedgeofphysics.pdf thegenome.pdf thegoldilocksenigma.pdf thesphinxatdawn.pdf unnaturalselection.pdf water_thefateofourmostpreciousresource.pdf x-15diary.pdf -- https://mail.python.org/mailman/listinfo/python-list
Re: Python library to break text into words
On Thursday, May 31, 2018 at 5:31:48 PM UTC-4, Dietmar Schwertberger wrote: > On 5/31/2018 10:26 PM, beliavsky--- via Python-list wrote: > > Is there a Python library that uses intelligent guesses to break sequences > > of characters into words? The general strategy would be to break strings > > into the longest words possible. The library would need to "know" a sizable > > subset of words in English. > > No need to re-invent the wheel: > > import webbrowswer > webbrowser.open( > "https://www.google.com/search?q=%s"%"atomicaccidents.pdf"+"+amazon";, new=0) > > > Copy the title from the browser window and paste it into your script's > window which will read it with input() and rename the file. > > Regards, > > Dietmar Thanks to both of you. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python is an Equal Opportunity Programming Language
On Thursday, May 5, 2016 at 3:00:01 PM UTC-4, Terry Reedy wrote: > https://motherboard.vice.com/blog/python-is-an-equal-opportunity-programming-language > > from an 'Intel(R) Software Evangelist' > -- > Terry Jan Reedy >From the link: MB: What is it about Python that makes it friendly to women? Is it something about the actual language itself? Or is it more of a subcultural thing within the community? DS: One thing that I think causes this is the founder of the Python project, a guy named Guido van Rossum. He's referred to as the "BDFL"--the Benevolent Dictator for Life. The way to think of him is like Linus Torvalds of Linux. Most of his keynote at that conference was answering questions from the people who had attended. And he actually said, "Let's alternate between men and women asking questions."On the second day of the conference, he was wearing a shirt from PyLadies, another nonprofit like Django Girls that helps women learn how to program on Python. * This not "equal opportunity". It is a quota system. It's my impression that in the U.S., Asians are over-represented among programmers relative to their share of the population and that whites and especially blacks are under-represented. Should we impose racial quotas on questions at conferences and call that "equal opportunity" as well? -- https://mail.python.org/mailman/listinfo/python-list
Re: Python is an Equal Opportunity Programming Language
On Friday, May 6, 2016 at 5:07:28 PM UTC-4, Ethan Furman wrote: > On 05/06/2016 01:35 PM, beliavsky--- via Python-list wrote: > > > Most of [Guido's] keynote at that conference was answering questions from > > the people who had attended. And he actually said, "Let's alternate > between > > men and women asking questions."On the second day of the conference, > he was > > wearing a shirt from PyLadies, another nonprofit like Django Girls > that helps > > women learn how to program on Python. > > > > * > > > > This not "equal opportunity". It is a quota system. > > It's a corrective action, a way of getting men accustomed to listening > to women and hearing good ideas and questions from them, and a way to > accustom women to speaking in (currently) male dominated groups. It's silly to say that just because a group is over-represented that it "dominates". If a conference has more Asians than whites does that necessarily make it Asian-dominated? > And it is far more equal opportunity than having 25 males ask questions > and only one or two females. Not if there are 25 males with questions and only one or two females with questions. Among the people who have questions, you could choose randomly. You and Terry Reedy misuse the term "equal opportunity". -- https://mail.python.org/mailman/listinfo/python-list
Re: Python is an Equal Opportunity Programming Language
On Saturday, May 7, 2016 at 4:02:32 AM UTC-4, Stephen Hansen wrote: > On Fri, May 6, 2016, at 11:43 PM, Gregory Ewing wrote: > > Steven D'Aprano wrote: > > > Who is setting and enforcing this quota, and given that only about 1 in 20 > > > Python programmers is a woman, do you think men are seriously missing out > > > on any opportunities? > > > > Suppose there are 100 people wanting to ask questions, and > > there is only time to answer 10 questions. If the 1 in 20 > > ratio holds, then 5 of those people are women and the other > > 95 are men. > > > > Alternating between men and women means that all of the > > women get their questions answered, and only 5/95 of the > > men. So in this example, if you're a woman you have a 100% > > chance of getting answered, and if you're a man you only > > have a 5.26% chance. > > > > Whether you think this is a good strategy or not, > > beliavsky is right that it's not "equal". > > This is a pedantically and nonsensical definition of "equal", that > ignores the many, many reasons why there are 1 in 20 women in that > conference. Its looking at the end effect and ignoring everything that > leads up to it, and deciding its instead special rights -- this is the > great argument against minorities getting a voice, that their requests > for equal *opportunity* are instead *special rights* that diminish the > established majority's entrenched power. > > Those women are dealing with suppression, discrimination and dismissal > on multiple levels that leave them in a disenfranchised position. The sex disparity in Python and in tech in general could be due in part to discrimination, but it could also be due to different male and female interests and (gasp) aptitudes on average. Are Asian-Americans over-represented in tech because whites have been suppressed? There are far more female than male teachers. I don't attribute it to anti-male suppression but to greater female interest in working with children. In our public middle school (grades 6-8, ages 11-13) there is a programming club that is open to girls. My son is shut out because of his sex. That is just as wrong as excluding him because of his skin color. I oppose such discrimination. -- https://mail.python.org/mailman/listinfo/python-list
Intel Distribution for Python
The Intel Distribution for Python 2017 Beta https://software.intel.com/en-us/python-distribution is available for Windows, Linux, and Mac OS for Python 2.7 and 3.5. "The Beta product adds new Python packages like scikit-learn, mpi4py, numba, conda, tbb (Python interfaces to Intel® Threading Building Blocks) and pyDAAL (Python interfaces to Intel® Data Analytics Acceleration Library). The Beta also delivers performance improvements for NumPy/SciPy through linking with performance libraries like Intel® MKL, Intel® Message Passing Interface (Intel® MPI), Intel® TBB and Intel® DAAL." I just installed Intel Python today. Has anyone tried it? Does it run your programs faster than the usual CPython? -- https://mail.python.org/mailman/listinfo/python-list
Re: Intel Distribution for Python
On Tuesday, May 10, 2016 at 11:17:33 PM UTC-4, Arshpreet Singh wrote: > Thanks for the information, I just applied for program but I got one mail > about license and expiration. > > > This software license expires on October 29, 2016. > > > I am not able to understand that can anyone put some light on that how > license can be expired? I assume that the Intel python.exe executable will stop running on that date. When I had a trial license for the Intel Fortran compiler, ifort.exe stopped working after one month. -- https://mail.python.org/mailman/listinfo/python-list
Re: Intel Distribution for Python
Intel has released Beta Update 1 of its Python distribution: "What's New! Jupyter* notebook interface Neural network APIs support for pyDAAL Optimized random number generation features for numpy.random package" -- https://mail.python.org/mailman/listinfo/python-list
Python Humble Bundle from Packt
For about the next two weeks, Humble Bundle https://www.humblebundle.com/books/python-packt-2019-books offers the following 18 books and 7 videos on Python for $15. BOOKS: Python Interviews OpenCV 3 Computer Vision with Python Cookbook Mastering Flask Web Development Python Automation Cookbook Python Machine Learning By Example Qt5 Python GUI Programming Cookbook. Python Microservices Development Hands-On Data Structures and Algorithms with Python Python High Performance Hands-On Software Engineering with Python Django 2 by Example Python Deep Learning Projects Mastering Python Networking Clean Code in Python Modern Python Cookbook Python 3 Object-Oriented Programming. Raspberry Pi 3 Cookbook for Python Programmers Django 2 Web Development Cookbook VIDEOS: Learn Python 3 from Scratch Data Visualization with Python: The Complete Guide REST APIs with Flask and Python Data Analysis with Pandas and Python Learn Python by Building a Blockchain and Cryptocurrency Python for Finance: Investment Fundamentals and Data Analytics Python For Offensive PenTest: A Complete Practical Course -- https://mail.python.org/mailman/listinfo/python-list
book on modern Python
I did some basic programming in Python 2 and now use Python 3. All I know about Python 3 is that print is a function requiring parentheses. What is a good book on modern Python that covers topics such as type annotations? I know of Fluent Python: Clear, Concise, and Effective Programming by Luciano Ramalho (2015) Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (2014) but wonder if the language has evolved significantly since they were published. I see that a 2nd edition of "Introducing Python" is due this year. -- https://mail.python.org/mailman/listinfo/python-list
discussion group for Python in finance?
Is there an active online group discussing the use of Python in finance? Here are some resources for Python in finance I know of. Numpy, scipy, pandas, and matplotlib are useful packages discussed in the books "Python for Finance" by Hilpisch and "Python for Data Analysis" by McKinney. Quandl is a good packages for importing financial and economic data. Quantopian is a site that lets you backtest strategies coded in Python. IBpy is a package for trading at Interactive Brokers using Python. Quantstart has e-books and a blog about Python in finance. Robert Carver wrote a book "Systmatic Trading" that has Python code, and he has a blog "Investment Idiocy". Python is often discussed in the "programming and software" forum of wilmott.com . -- https://mail.python.org/mailman/listinfo/python-list
Exclude every nth element from list?
I can use x[::n] to select every nth element of a list. Is there a one-liner to get a list that excludes every nth element? -- https://mail.python.org/mailman/listinfo/python-list
Re: Exclude every nth element from list?
On Saturday, March 26, 2016 at 1:02:06 PM UTC-4, Gary Herron wrote: > On 03/26/2016 09:49 AM, beliavsky--- via Python-list wrote: > > I can use x[::n] to select every nth element of a list. Is there a > > one-liner to get a list that excludes every nth element? > > Yes: > > >>> L=list(range(20)) > >>> [x for i,x in enumerate(L) if i%3 != 0] > [1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19] > > > Gary Herron > > > -- > Dr. Gary Herron > Department of Computer Science > DigiPen Institute of Technology > (425) 895-4418 Thanks to you and others who replied. I see that enumerate is a useful function. -- https://mail.python.org/mailman/listinfo/python-list
repeat items in a list
I can create a list that has repeated elements of another list as follows: xx = ["a","b"] nrep = 3 print xx yy = [] for aa in xx: for i in range(nrep): yy.append(aa) print yy output: ['a', 'b'] ['a', 'a', 'a', 'b', 'b', 'b'] Is there a one-liner to create a list with repeated elements? -- https://mail.python.org/mailman/listinfo/python-list
Re: repeat items in a list
On Saturday, March 26, 2016 at 7:24:10 PM UTC-4, Erik wrote: > Hi, > > On 26/03/16 22:12, beliavsky--- via Python-list wrote: > > I can create a list that has repeated elements of another list as follows: > > > > xx = ["a","b"] > > nrep = 3 > > print xx > > yy = [] > > for aa in xx: > > for i in range(nrep): > > yy.append(aa) > > print yy > > > > output: > > ['a', 'b'] > > ['a', 'a', 'a', 'b', 'b', 'b'] > > > > Is there a one-liner to create a list with repeated elements? > > yy = reduce(lambda a, b: a + b, ([i] * nrep for i in xx), []) > > Or, if you want to "import operator" first, you can use 'operator.add' > instead of the lambda (but you _did_ ask for a one-liner ;)). > > Out of interest, why the fascination with one-liners? Thanks for your reply. Sometimes when I program in Python I think I am not using the full capabilities of the language, so I want to know if there are more concise ways of doing things. -- https://mail.python.org/mailman/listinfo/python-list
Re: repeat items in a list
On Saturday, March 26, 2016 at 7:30:14 PM UTC-4, Mark Lawrence wrote: > On 26/03/2016 22:12, beliavsky--- via Python-list wrote: > > I can create a list that has repeated elements of another list as follows: > > > > xx = ["a","b"] > > nrep = 3 > > print xx > > yy = [] > > for aa in xx: > > for i in range(nrep): > > yy.append(aa) > > print yy > > > > output: > > ['a', 'b'] > > ['a', 'a', 'a', 'b', 'b', 'b'] > > > > Is there a one-liner to create a list with repeated elements? > > > > yy = [aa for aa in xx for _ in range(nrep)] > > I suggest that you try this sort of the thing at an interactive prompt, > it's a great way to learn. > > You might also want to take a look at the itertools module > https://docs.python.org/3/library/itertools.html. This is often used in > building structures like the ones you've been asking about today. To me > it is the Swiss Army Knife of the stdlib. Thanks for the one-liner, which I prefer to the one I made up using itertools: yy = list(chain.from_iterable([list(repeat(aa,nrep)) for aa in xx])) -- https://mail.python.org/mailman/listinfo/python-list
Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?
On Sunday, May 10, 2015 at 9:38:38 PM UTC-4, Ian wrote: > On Sun, May 10, 2015 at 3:16 PM, Marko Rauhamaa wrote: > > Scheme is my favorite language. I think, however, it is a pretty > > advanced language and requires a pretty solid basis in programming and > > computer science. > > > > Python, in contrast, is a great introductory programming language. Sure, > > you *can* get quite advanced with it, too, but you can get quite a bit > > of fun stuff done with just the basics. > > MIT famously used Scheme in their introductory course for more than > two decades. Although they switched to Python a few years ago, I don't > think they did so because there was anything wrong with Scheme. > Wikipedia informs me that Yale and Grinnell are still using Scheme for > their introductory courses. Yale has taken the unusual step of outsourcing its introductory CS class to Harvard, which uses C as the main language in its CS50 class. http://yaledailynews.com/blog/2014/11/07/faculty-approve-cs50-for-yale/ Faculty approve CS50 for Yale "Just under a month after announcing that Yale's computer science department was considering importing Harvard's most popular course, faculty voted to bring CS50 to Yale. Following what Yale College Dean Jonathan Holloway described as a "long, healthy discussion," faculty at Thursday's monthly meeting voted overwhelmingly to approve CS50 as a class to be taught at Yale. Computer science department chair Joan Feigenbaum said that the next step for CS50 will be for Harvard to approve the sharing of CS50 with Yale. If the course earns approval, she noted, Yale will formally introduce the class in Fall 2015." -- https://mail.python.org/mailman/listinfo/python-list
Python programming classes for children
My 11yo son is taking the online class "Intermediate Programming with Python" http://www.artofproblemsolving.com/school/course/catalog/python2 offered by the Art of Problem Solving company (AoPS). Classes meet for 1.5 hours a week for 12 weeks. During the classes the instructor "lectures" (types into a console -- there is no sound) and students type answers to questions. There are weekly programming assignments. AoPS is a U.S. company whose focus is preparing students for math competitions. Are there other groups offering Python courses for pre-college students? -- https://mail.python.org/mailman/listinfo/python-list
Re: The EuroPython 2015 Keynotes
On Friday, July 10, 2015 at 7:21:14 AM UTC-4, M.-A. Lemburg wrote: > With Mandy Waite we have announced all keynotes for EuroPython 2015: > 5 keynotes, 6 speakers, 4 women and 2 men. Your mentioning these numbers makes me wonder if the organizing committee is using gender preferences in its selection of keynote speakers. I hope not. It is better to choose the speakers who will give the most interesting talks and let the demographic chips fall where they may. -- https://mail.python.org/mailman/listinfo/python-list
Re: The EuroPython 2015 Keynotes
On Friday, July 10, 2015 at 2:58:18 PM UTC-4, Chris Angelico wrote: > On Fri, Jul 10, 2015 at 10:01 PM, beliavsky--- via Python-list > wrote: > > On Friday, July 10, 2015 at 7:21:14 AM UTC-4, M.-A. Lemburg wrote: > >> With Mandy Waite we have announced all keynotes for EuroPython 2015: > >> 5 keynotes, 6 speakers, 4 women and 2 men. > > > > Your mentioning these numbers makes me wonder if the organizing committee > > is using gender preferences in its selection of keynote speakers. I hope > > not. It is better to choose the speakers who will give the most interesting > > talks and let the demographic chips fall where they may. > > > > I think that's more a matter of having the statistically-curious > brain. In my father's family, there are 5 sons and 2 daughters - does > that indicate gender preference in my reporting, or just an > acknowledgement of a fact? If 80% of Python programmers and potential speakers at a Python conference are male, the chance of 4 out 6 speakers being female is fairly low if gender is ignored. Some people think gender diversity in tech is so important that there should be gender preferences -- see for example this post by a Python blogger http://ilovesymposia.com/2015/04/03/calling-out-scipy-on-diversity/ . It is plausible that the organizers preferred female keynote speakers. Can the OP comment on this? -- https://mail.python.org/mailman/listinfo/python-list
Re: Python speed
On Friday, August 7, 2015 at 10:08:37 AM UTC-4, roge...@gmail.com wrote: > Can anyone compare PyNum calculation speed to Fortran? > > This is for a number crunching program working with large files. > > Roger Did you mean NumPy? It depends on the program. Here are two posts that compared speeds. Comparing Python, NumPy, Matlab, Fortran, etc. (2009) https://modelingguru.nasa.gov/docs/DOC-1762 Optimizing Python in the Real World: NumPy, Numba, and the NUFFT (2015) https://jakevdp.github.io/blog/2015/02/24/optimizing-python-with-numpy-and-numba/ -- https://mail.python.org/mailman/listinfo/python-list
Planet Scipy blog
There used to be a blog about SciPy at https://planet.scipy.org/ , discussing the applications of Python to scientific computing. Now there is a static page about "MPI for Python". What happened? -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 2 vs Python 3 for teaching
I think Python 2.x is still used more than Python 3.x in scientific computing. The Python books I have in this area, such as "Python for Finance: Analyze Big Financial Data" and "Python for Data Analysis", still use Python 2.x . An aspiring computational scientist, data scientist, or financial quant may still be better off learning Python 2.x but using print(x) rather than print x and doing other things to future-proof his code. -- https://mail.python.org/mailman/listinfo/python-list
Refactoring tool to create Python functions
Googling "refactoring python code to create functions" I came to https://wingware.com/doc/intro/tutorial-refactoring where the "Extract Function/Method" does what I want. Is there a free Python tool that does this? -- https://mail.python.org/mailman/listinfo/python-list