book on modern Python

2019-07-25 Thread beliavsky--- via Python-list
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 Luc

Python Humble Bundle from Packt

2019-01-01 Thread beliavsky--- via Python-list
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 Cookbo

Re: Python library to break text into words

2018-05-31 Thread beliavsky--- via Python-list
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 t

Python library to break text into words

2018-05-31 Thread beliavsky--- via Python-list
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 t

Humble Book Bundle: Python by Packt

2018-01-01 Thread beliavsky--- via Python-list
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

Refactoring tool to create Python functions

2017-05-08 Thread beliavsky--- via Python-list
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

Re: Intel Distribution for Python

2016-06-09 Thread beliavsky--- via Python-list
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

Re: Intel Distribution for Python

2016-05-11 Thread beliavsky--- via Python-list
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

Intel Distribution for Python

2016-05-10 Thread beliavsky--- via Python-list
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 Bui

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread beliavsky--- via Python-list
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

Re: Python is an Equal Opportunity Programming Language

2016-05-06 Thread beliavsky--- via Python-list
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, &quo

Re: Python is an Equal Opportunity Programming Language

2016-05-06 Thread beliavsky--- via Python-list
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?

Re: repeat items in a list

2016-03-26 Thread beliavsky--- via Python-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"] > > nre

Re: repeat items in a list

2016-03-26 Thread beliavsky--- via Python-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 &g

repeat items in a list

2016-03-26 Thread beliavsky--- via Python-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 element

Re: Exclude every nth element from list?

2016-03-26 Thread beliavsky--- via Python-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: >

Exclude every nth element from list?

2016-03-26 Thread beliavsky--- via Python-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

discussion group for Python in finance?

2016-03-18 Thread beliavsky--- via Python-list
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

Re: Python 2 vs Python 3 for teaching

2015-11-02 Thread beliavsky--- via Python-list
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 q

Planet Scipy blog

2015-10-08 Thread beliavsky--- via Python-list
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 speed

2015-08-07 Thread beliavsky--- via Python-list
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

Re: The EuroPython 2015 Keynotes

2015-07-10 Thread beliavsky--- via Python-list
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 Eu

Re: The EuroPython 2015 Keynotes

2015-07-10 Thread beliavsky--- via Python-list
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 selec

Python programming classes for children

2015-07-01 Thread beliavsky--- via Python-list
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

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-11 Thread beliavsky--- via Python-list
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

Re: EuroPython 2015: Django Girls Workshop

2015-04-17 Thread beliavsky
On Friday, April 17, 2015 at 1:25:51 PM UTC-4, M.-A. Lemburg wrote: > We are happy to announce that we will be hosting a Django Girls Workshop > during the EuroPython 2015. It will take place on 20th of July, the > first day of the conference. > > We believe in the work that this group is doing to

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread beliavsky
On Friday, January 30, 2015 at 5:51:38 PM UTC-5, Gregory Ewing wrote: > Michael Torrie wrote: > > On 01/30/2015 10:31 AM, Rustom Mody wrote: > > > >>And what about the grey area between lightweight and heavyweight? > > > > That's what the smart pointers are for. > > I'd say it's what higher-leve

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread beliavsky
On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: > Hi, > I am not sure here is the right place to ask this question, but I want to > give it a shot:) > are there fortran libs providing python like data type, such as set, dict, > list? > Thanks, > Yours liuzhenhai The "Fortr

Re: Python 3 is killing Python

2014-08-06 Thread beliavsky
On Wednesday, May 28, 2014 6:38:22 PM UTC-4, Ben Finney wrote: > Larry Martell writes: > > > > > No company that I work for is using python 3 - they just have too much > > > of an investment in a python 2 code base to switch. > > > > There are many large companies still using FORTRAN and CO

lists vs. NumPy arrays for sets of dates and strings

2014-06-09 Thread beliavsky
I am going to read a multivariate time series from a CSV file that looks like Date,A,B 2014-01-01,10.0,20.0 2014-01-02,10.1,19.9 ... The numerical data I will store in a NumPy array, since they are more convenient to work with than lists of lists. What are the advantages and disadvantages of st

Re: Python(x,y) interferes with earlier Numpy installation

2014-02-13 Thread beliavsky
I fixed the problem by reinstalling Numpy. -- https://mail.python.org/mailman/listinfo/python-list

Python(x,y) interferes with earlier Numpy installation

2014-02-13 Thread beliavsky
I am running Python 2.7.5 on Windows 7 and installed Numpy, which worked. Then I installed Python(x,y) from a file Python(x,y)-2.7.5.2.exe, and now running the script from numpy import array, size, shape, min, max, sum a = array([1, 2, 3]) print shape(a) gives the error messages Traceback (most

Re: Python 3.x adoption

2014-01-18 Thread beliavsky
On Friday, January 17, 2014 6:03:45 PM UTC-5, Terry Reedy wrote: > On 1/17/2014 5:16 PM, beliav...@aol.com wrote: > > Python 2 and 3 are incompatible in ways that do not apply to Fortran > > > standards pre- and post- F77. > > > > As stated above, I disagree with respect to pre-F77 and F77

Re: Python 3.x adoption

2014-01-17 Thread beliavsky
On Tuesday, January 14, 2014 2:38:29 PM UTC-5, Skip Montanaro wrote: > > What's the problem with Python 3.x? It was first released in 2008, but > > > web hosting companies still seem to offer Python 2.x rather. > > > > > > For example, Google App Engine only offers Python 2.7. > > > > > > What

Re: Best Python book(s) for a pre-teen?

2013-08-01 Thread beliavsky
On Tuesday, February 18, 2003 2:27:58 PM UTC-5, Mike Silva wrote: > Hi all, > > My son is 11 and wants to try programming, partly because it's what I > do for a living. Even though I don't (yet?) use or even know Python, > through some unexplainable thought process I've decided it would be a > go

Why did Quora choose Python for its development?

2011-05-20 Thread Beliavsky
I thought this essay on why one startup chose Python was interesting. http://www.quora.com/Why-did-Quora-choose-Python-for-its-development PHP was out of the question. Facebook is stuck on that for legacy reasons, not because it's the best choice right now.[1] Our main takeaway from that experien

XEmacs output from Python

2011-02-01 Thread Beliavsky
The script name = raw_input("What is your name? ") print "Hello, ",name runs fine from the Windows prompt (cmd.exe), but when I run it in a shell buffer under XEmacs, I only see the text "What is your name? " AFTER I enter some text, so a run looks like this: H:\python>python xinput.py x What is

scipy code runs in empty directory, not another

2010-11-13 Thread Beliavsky
After installing numpy, scipy, and matplotlib for python 2.6 and running the code from http://www.scipy.org/Cookbook/OptimizationDemo1 (stored as xoptimize.py) in a directory with other python codes, I got the error messages C:\python\code\mycode>python xoptimize.py Traceback (most recent call las

processing email with Python on Windows?

2008-10-03 Thread Beliavsky
I work for a financial company where we run Windows XP and read email using Microsoft Outlook 2003. I get daily files that come as email attachments from various counterparties. I save them as h:\firm_name \mmdd.csv . Would Python be a good tool to automate the process of saving reports, or wou

Re: Books to begin learning Python

2008-08-07 Thread Beliavsky
On Aug 6, 4:08 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Aug 6, 2:56 pm, Edward Cormier <[EMAIL PROTECTED]> wrote: > > > Which computer books are the best to begin learning Python 2.5 with? > > I've heard that Learning Python 3rd Edition is a good choice - can > > anyone give any more advic

Re: Python Book Recommendations

2007-08-15 Thread Beliavsky
On Aug 15, 10:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > If I could have only one book, I would buy "Core Python, Second > Edition," by Wesley Chun. I have bought about half a dozen Python books but will purchase only Python 3 books in the future, when they become available. I wonder whe

Re: Where do they tech Python officialy ?

2007-07-24 Thread Beliavsky
On Jul 23, 1:27 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > Autodidacticism is an alternative; feel free to regard > http://wiki.python.org/moin/PythonTraining> as a member of > that class. > > If you, for example, were to teach yourself Python, then > volunteer with prominent extensions or

Re: Pass by reference or by value?

2007-07-16 Thread Beliavsky
On Jul 13, 11:58 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > In Fortran you can only pass references. > > integer(4) :: a > a = 1 > call bar(a) > > subroutine bar(a) > integer(4) :: a > a = 0 ! side-effect > end subroutine > > That means, when a variable is used to call a function,

compressing consecutive spaces

2007-07-09 Thread Beliavsky
How can I replace multiple consecutive spaces in a file with a single character (usually a space, but maybe a comma if converting to a CSV file)? Ideally, the Python program would not compress consecutive spaces inside single or double quotes. An inelegant method is to repeatedly replace two consec

Re: Python compared to other language

2007-05-18 Thread Beliavsky
On May 18, 3:04 pm, scott <[EMAIL PROTECTED]> wrote: > Hi all, > > I have been looking at the various programming languages available. I > have programed in Basic since I was a teenager and I also have a basic > understanding of C, but I want something better. > > Can anybody tell

Re: List Moderator

2007-05-18 Thread Beliavsky
On May 18, 9:22 am, [EMAIL PROTECTED] wrote: > You're probably right, but this week has been pretty bad. Every few > posts there's another porn or boob related link. Sheesh! > > Mike I wish Google Groups were enhanced to let users block messages according to (1) "keywords" (2) average ranking

Re: Python-URL! - weekly Python news and links (May 16)

2007-05-17 Thread Beliavsky
On May 16, 2:45 pm, "Cameron Laird" <[EMAIL PROTECTED]> wrote: > QOTW: "Sometimes you just have to take the path of least distaste". - Grant > Edwards > > "I want to choose my words carefully here, so I'm not misunderstood. I think Cameron Laird does a good job with the Python digest but blun

Re: Trying to choose between python and java

2007-05-15 Thread Beliavsky
On May 15, 1:30 am, Anthony Irwin <[EMAIL PROTECTED]> wrote: > #5 someone said that they used to use python but stopped because the > language changed or made stuff depreciated (I can fully remember > which) and old code stopped working. Is code written today likely to > still work in 5+ years o

Re: Single precision floating point calcs?

2007-05-10 Thread Beliavsky
Off-topic, but maybe as practical as "[making] your own Python build from altered source." --- Fortran 95 (and earlier versions) has single and double precision floats. One could write a Fortran code with variables declared REAL, and compilers will by default treat the REALs as single precision, b

Re: Numbers and truth values

2007-04-29 Thread Beliavsky
On Apr 28, 4:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > John Nagle <[EMAIL PROTECTED]> wrote: > > > I'd have to consider that a bug. > > > Some very early FORTRAN compilers allowed you to redefine > > integer constants: > > > CALL SET(25,99) > > WRITE (6,100) 25 > >

Re: Portable SciPy v0.1 released

2007-04-27 Thread Beliavsky
On Apr 27, 6:17 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: > Portable SciPy, is an easy installer of SciPy for M$ windows users. If you have an announcement for Windows users, I suggest that you not needlessly turn them off by abbreviating Microsoft as M$ . You don't like Windows, but many of us

Re: Generalized range

2007-04-27 Thread Beliavsky
On Apr 27, 1:32 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Michael Hoffman <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > Thanks - you have covered a fair bit of gorund here - I will modify > > > myRange taking your suggestions into account. The one suggestion that > > > I'm goin

Re: Python Feature Request: Explicit variable declarations

2007-04-20 Thread Beliavsky
On Apr 14, 6:21 am, [EMAIL PROTECTED] wrote: > Hello. Please tell me whether this feature request is sane (and not > done before) for python so it can be posted to the python-dev mailing > list. I should say first that I am not a professional programmer with > too much technical knowledge. > > I wo

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Beliavsky
On Apr 14, 10:12 pm, "Paddy" <[EMAIL PROTECTED]> wrote: > So the running count is: > Ayes to the left: VB compatibility. > Nays to the right: QuadIO, Perl, Dijkstra paper. > > The nays have it! One-based indexing would also Python more compatible with Fortran, Matlab/Octave/Scilab, and S

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-15 Thread Beliavsky
On Apr 14, 10:55 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > The FORTRAN family had started as 1-based (F95, and Ada, now allow > for each array to have its own "base" => x : array (-10..10) of float). Fortran has allowed a user-specified base since at least the 1977 standard --

Re: Fortran vs Python - Newbie Question

2007-03-27 Thread Beliavsky
On Mar 27, 6:32 am, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>,Beliavsky <[EMAIL PROTECTED]> wrote: > > . > . > . > > > > >Your experience with Fortran

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Beliavsky
On Mar 26, 10:16 am, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>,[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >Is there a mac version?? > >Thanks > >Chris > > Yes. > > Several, in fact--all available at no charge. The Python > world is different from what experienc

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Beliavsky
On Mar 26, 10:31 am, "Carl Banks" <[EMAIL PROTECTED]> wrote: > > You can write programs in Python that do usefully complicated things, > > and you can get them to work in a reasonable time. Fortran can't do > > this, for anything more than the trivial. "Classic" Fortran tasks of > > the past are

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Beliavsky
On Mar 26, 9:06 am, stef <[EMAIL PROTECTED]> wrote: > As said by others, "Portability, scalability & RAD" as an advantage of > Python are probably far more important. All of those claimed advantages can be debated, although they may exist for some tasks. (1) Portability. Fortran has been run on

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Beliavsky
On Mar 26, 8:42 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > You can get the speed of fortran in Python by using libraries like > Numeric without losing the readability of Python. Numeric and Numpy will faster than raw Python for array operations, but I don't think they will match well-

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Beliavsky
On Mar 26, 8:40 am, [EMAIL PROTECTED] wrote: > On Mar 26, 8:20 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > OK... > > I've been told that Both Fortran and Python are easy to read, and are > > quite useful in creating scientific apps for the number crunching, but > > then Python is a tad

check if files are the same on Windows

2007-03-19 Thread Beliavsky
A crude way to check if two files are the same on Windows is to look at the output of the "fc" function of cmd.exe, for example def files_same(f1,f2): cmnd= "fc " + f1 + " " + f2 return ("no differences" in popen(cmnd).read()) This is needlessly slow, because one can stop comparing tw

Re: Python stock market analysis tools?

2007-03-05 Thread Beliavsky
On Mar 5, 12:41 am, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > On Mar 4, 7:52 pm, "Mudcat" <[EMAIL PROTECTED]> wrote: > > > I have done a bit of searching and can't seem to find a stock market > > tool written in Python that is active. Anybody know of any? I'm trying > > not to re-create the

Re: f2py and Fortran90 gfortran_filename error

2007-02-28 Thread Beliavsky
On Feb 28, 12:40 am, Robert Kern <[EMAIL PROTECTED]> wrote: > Tyler wrote: > > Hello All: > > > Since my last post I have attempted to use the f2py program which > > comes with numpy. > > It's better to ask these questions on numpy-discussion, instead. There are > more > f2py users per capita ther

Re: Pep 3105: the end of print?

2007-02-20 Thread Beliavsky
On Feb 16, 10:17 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 16 Feb 2007 09:49:03 -0500, Jean-Paul Calderone wrote: > > On Sat, 17 Feb 2007 01:32:21 +1100, Steven D'Aprano > >> [snip] > > >>I don't think that follows at all. print is only a problem if you expect > >>your code to work u

Re: Reading Fortran Data

2007-01-21 Thread Beliavsky
Carl Banks wrote: > > A Fortran > > list-directed write can print results in an almost arbitrary format, > > depending on the compiler. Many compilers will separate integers by > > several spaces, not just one, and they could use commas instead of > > spaces if they wanted. > > 1. Hardly any co

Re: Reading Fortran Data

2007-01-21 Thread Beliavsky
Carl Banks wrote: > > WRITE(90,*) nfault,npoint > > Fortran writes this as two arbitrary integers separated by a space. I wrote a paragraph in my reply explaining why this is wrong. A Fortran list-directed write can print results in an almost arbitrary format, depending on the compiler. Many

Re: Reading Fortran Data

2007-01-21 Thread Beliavsky
Tyler wrote: > Hello All: > > After trying to find an open source alternative to Matlab (or IDL), I > am currently getting acquainted with Python and, in particular SciPy, > NumPy, and Matplotlib. While I await the delivery of Travis Oliphant's > NumPy manual, I have a quick question (hopefully) re

Re: Dividing integers...Convert to float first?

2007-01-05 Thread Beliavsky
Thomas Ploch wrote: > Jonathan Smith schrieb: > > Thomas Ploch wrote: > >> [EMAIL PROTECTED] schrieb: > >>> I'm still pretty new to Python. I'm writing a function that accepts > >>> thre integers as arguments. I need to divide the first integer by te > >>> second integer, and get a float as a resu

Re: Writing more efficient code

2007-01-01 Thread Beliavsky
If in the newsgroup comp.lang.x somone asks how to do y, and you suggest using language z, without answering their question, which was how to do it in x, you will likely just annoy people and perhaps make it even less likely that they will try z. I have my own favorite language z and have not alwa

Re: Wow, Python much faster than MatLab

2006-12-29 Thread Beliavsky
Stef Mientki wrote: > hi All, > > instead of questions, > my first success story: > > I converted my first MatLab algorithm into Python (using SciPy), > and it not only works perfectly, > but also runs much faster: > > MatLab: 14 msec > Python: 2 msec For times this small, I wonder if timing com

Re: first and last index as in matlab

2006-12-17 Thread Beliavsky
Evan wrote: > In matlab I can do the following: > > >> ind = [3,5,7,2,4,7,8,24] > ind = 3 5 7 2 4 7 824 > >> ind(1) ans = 3 > >> ind(end) ans =24 > >> ind([1 end]) ans = 324 > > but I can't get the last line in python: > > In [690]: ind =

Re: automatically grading small programming assignments

2006-12-14 Thread Beliavsky
Brian Blais wrote: > Hello, > > I have a couple of classes where I teach introductory programming using > Python. What > I would love to have is for the students to go through a lot of very small > programs, > to learn the basic programming structure. Things like, return the maximum in > a lis

Re: About alternatives to Matlab

2006-12-11 Thread Beliavsky
I came across SAGE "Software for Algebra and Geometry Experimentation" http://sage.math.washington.edu/sage/ , which includes Python and Numeric and consists of Group theory and combinatorics -- GAP Symbolic computation and Calculus -- Maxima Commutative algebra -- Singular Number theory -- PARI,

Re: Automatic debugging of copy by reference errors?

2006-12-11 Thread Beliavsky
Carl Banks wrote: > Niels L Ellegaard wrote: > > Marc 'BlackJack' Rintsch wrote: > > > In <[EMAIL PROTECTED]>, Niels L > > > Ellegaard wrote: > > > > I have been using scipy for some time now, but in the beginning I made > > > > a few mistakes with copying by reference. > > > But "copying by refer

Re: feed-forward neural network for python

2006-12-07 Thread Beliavsky
mwojc wrote: > Hi! > I released feed-forward neural network for python (ffnet) project at > sourceforge. Implementation is extremelly fast (code written mostly in > fortran with thin python interface, scipy optimizers involved) and very > easy to use. > I'm announcing it here because you, folks, a

Re: len() and PEP 3000

2006-12-06 Thread Beliavsky
Thomas Guettler wrote: > Hi, > > The function len() is not mentioned in the Python 3000 PEPs. > > I suggest that at least lists, tupples, sets, dictionaries and strings > get a len() method. I think the len function can stay, removing it > would break to much code. But adding the method, would bu u

Re: How do I print a numpy array?

2006-12-01 Thread Beliavsky
Robert Kern wrote: > Grant Edwards wrote: > > How do you print a numpy array? > > > > I tried the obvious print a, print `a`, and print str(a), but > > none of them work on anything other than trivially small > > arrays. Most of my real data is elided and replaced with > > ellipses. > > You might

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Beliavsky
Will McGugan wrote: > Steve Bergman wrote: > > Just wanted to report a delightful little surprise while experimenting > > with psyco. > > The program below performs astonoshingly well with psyco. > > > > It finds all the prime numbers < 10,000,000 > > Actualy, it doesn't. You forgot 1 and 2. The n

Re: Quadratic Optimization Problem

2006-11-22 Thread Beliavsky
Stefan Behnel wrote: > [EMAIL PROTECTED] wrote: > > I need to do a quadratic optimization problem in python where the > > constraints are quadratic and objective function is linear. > > > > What are the possible choices to do this. > > Too bad these homework assignments get trickier every time, isn

Re: Finding skilled pythonistas for micro-jobs?

2006-11-18 Thread Beliavsky
I have gotten some Python tasks done at http://www.rentacoder.com. Progammers are cheaper outside the U.S. and Western Europe, and you can get a lot done for even $100. -- http://mail.python.org/mailman/listinfo/python-list

Re: accessing fortran modules from python

2006-11-16 Thread Beliavsky
sam wrote: > hello all, > > i am currently in the process of planning a piece of software to model > polymerisation kinetics, and intend to use python for all the > high-level stuff. the number-crunching is something i would prefer to > do in fortran (which i have never used, but will learn), but

Re: Programmatically finding "significant" data points

2006-11-14 Thread Beliavsky
erikcw wrote: > Hi all, > > I have a collection of ordered numerical data in a list. Called a "time series" in statistics. > The numbers > when plotted on a line chart make a low-high-low-high-high-low (random) > pattern. I need an algorithm to extract the "significant" high and low > points fr

article on Python 2.5 features

2006-11-12 Thread Beliavsky
A Parade of New Features Debuts in Python 2.5 by Gigi Sayfan "Python 2.5 still has the smell of fresh paint but it's the perfect time to drill down on the most important new features in this comprehensive release. Read on for detailed explanations and examples of exception handling, resource manage

profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Beliavsky
Cliff Wells wrote: > On Mon, 2006-11-06 at 18:20 -0800, Beliavsky wrote: > > Carl J. Van Arsdall wrote: > > > > > > > > > Pyro is fucking amazing and has been a great help to a couple of our > > > projects. > > > > You should watch your

Re: PSF Infrastructure has chosen Roundup as the issue tracker for Python development

2006-10-21 Thread beliavsky
BJörn Lindqvist wrote: > On 10/20/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > > At the beginning of the month the PSF Infrastructure committee announced > > that we had reached the decision that JIRA was our recommendation for the > > next issue tracker for Python development. I wonder if the co

Re: EXCITING OPPORTUNITY FOR EXPERIENCED APPLICATION DEVELOPERS (PYTHON)

2006-10-16 Thread beliavsky
If the company is so good, why does it hire recruiters like you? It is rude to SHOUT your subject in all caps. Your subject conveys nothing more than "Python job offered". You should have mentioned in the subject that the job is in Hyderabad, because even most readers of this group looking for j

Re: OT: productivity and long computing delays

2006-09-27 Thread beliavsky
Paul Rubin wrote: > I'm doing something where I frequently but unpredictably (i.e. I can't > plan for it in advance) hit a snag that requires me to rebuild a large > project. The rebuild takes a couple hours. During that time, I'm > twiddling my thumbs and/or posting here, i.e. not getting anythi

why a main() function?

2006-09-18 Thread beliavsky
I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print "hi" main() instead of print "hi" What are the advantages of doing this? -- http://mail.python.org/mailman/listinfo/python-list

How to make an announcement (was Re: ANN: GMPY binaries for Windows 2.5)

2006-09-01 Thread beliavsky
[EMAIL PROTECTED] wrote: > GMPY binaries for Python 2.5 are available at > http://home.comcast.net/~casevh/ "The General Multiprecision PYthon project (GMPY) focuses on Python-usable modules providing multiprecision arithmetic functionality to Python programmers." A sign of Python's health is tha

Re: where can i get older version of python?

2006-08-17 Thread beliavsky
[EMAIL PROTECTED] wrote: > does any one know where can I get older version of python for windows? > > I am looking for versions between 2.0 and 2.2. http://www.python.org/download/releases/ -- http://mail.python.org/mailman/listinfo/python-list

programming with Python 3000 in mind

2006-08-15 Thread beliavsky
At http://www-03.ibm.com/developerworks/blogs/page/davidmertz David Mertz writes "Presumably with 2.7 (and later 2.x versions), there will be a means of warning developers of constructs that are likely to cause porting issues [to Python 3000]. In the simplest case, this will include deprecated fun

Re: Python Projects Continuous Integration

2006-07-28 Thread beliavsky
Harry George wrote: > "Dave Potts" <[EMAIL PROTECTED]> writes: > > > Hi, > > > > I'm just starting a development project in Python having spent time in > > the Java world. I was wondering what tool advice you could give me > > about setting up a continuous integration environment for the python >

Re: Making a time series analysis package in python - advice or assistance sought

2006-07-07 Thread beliavsky
Ray Tomes wrote: > Hi Folks > > I am an old codger who has much experience with computers > in the distant past before all this object oriented stuff. > Also I have loads of software in such languages as FORTRAN > and BASIC, QBASIC etc that is very useful except that it > really doesn't like to run

source reduction using Python

2006-06-21 Thread beliavsky
Intel has introduced something called CESR, written in Python, to aid C, C++, and Fortran programmers in reducing the sizes of programs included in bug reports. Here is a brief description from http://cache-www.intel.com/cd/00/00/21/93/219320_relnotes_10.pdf : "Compiler Error Source Reducer (CESR)

Re: Econometrics in Panel data?

2006-05-10 Thread beliavsky
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, I counseled: > >In article <[EMAIL PROTECTED]>, > >DeepBlue <[EMAIL PROTECTED]> wrote: > >>so are you saying that Python is not an appropriate language for doing > >>econometrics stuff? > >> > >> > >>Dennis Lee Bieber wrote: > >>> On Tue, 09 M

Re: Econometrics in Panel data?

2006-05-08 Thread beliavsky
DeepBlue wrote: > Hi all, > > I am new to Python. Just wondering can Python able to do econometric > regression in either Time-series or pooled (panel) data? As well as test > for hetero, autocorrelation, or endogeneity? > Thank you! NumPy can do linear regression, and one can certainly program a

connect file object to standard output?

2006-05-08 Thread beliavsky
I want to write a function that writes to an output file if specified and otherwise to standard output. How can I connect a file object to standard output in the code below? I could use an if statement to choose between print and print>>fp throughout the function, but this seems awkward. I think th

Re: search file for tabs

2006-05-02 Thread beliavsky
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > The following code to search a file for tabs does not work, at least on > > Windows XP. Could someone please tell me what's wrong? Thanks. > > > > xfile = "file_with_tabs.txt" > > for text in open(xfile,"r"): > > text = text.strip() > >

search file for tabs

2006-05-02 Thread beliavsky
The following code to search a file for tabs does not work, at least on Windows XP. Could someone please tell me what's wrong? Thanks. xfile = "file_with_tabs.txt" for text in open(xfile,"r"): text = text.strip() if ("\t" in text): print text -- http://mail.python.org/mailman/lis

  1   2   3   >