Hello.
I am new to Python. It seems a very interesting language to me. Its
simplicity is very attractive.
However, it is usually said that Python is not a compiled but
interpreted programming language —I mean, it is not like C, in that
sense.
I am working on my PhD Thesis, which is about Operations Research,
heuristic algorithms, etc., and I am considering the possibility of
programming all my algorithms in Python.
The usual alternative is C, but I like Python more.
The main drawbacks I see to using Python are these:
* As far as I understand, the fact that Python is not a compiled
language makes it slower than C, when performing huge amounts of
computations within an algorithm or program.
* I don't know how likely it is to find libraries in Python related to
my research field.
* I know Python is a "serious" and mature programming language, of
course. But I do not know if it is seen as "just funny" in a research
context. Is Python considered as a good programming language for
implementing Operations Research algorithms, such as heuristics and
other soft-computing algorithms?
Maybe this is not the right forum, but maybe you can give me some
hints or tips...
Thank you in advance. 53 5247
Vicent Giner wrote:
Hello.
I am new to Python. It seems a very interesting language to me. Its
simplicity is very attractive.
However, it is usually said that Python is not a compiled but
interpreted programming language —I mean, it is not like C, in that
sense.
I am working on my PhD Thesis, which is about Operations Research,
heuristic algorithms, etc., and I am considering the possibility of
programming all my algorithms in Python.
The usual alternative is C, but I like Python more.
The main drawbacks I see to using Python are these:
* As far as I understand, the fact that Python is not a compiled
language makes it slower than C, when performing huge amounts of
computations within an algorithm or program.
The usual answer is that development
time is more important than running time.
Since you are likely to be using arrays,
you might look at numpy, where the
number crunching is using compiled C code.
>
* I don't know how likely it is to find libraries in Python related to
my research field.
* I know Python is a "serious" and mature programming language, of
course. But I do not know if it is seen as "just funny" in a research
context. Is Python considered as a good programming language for
implementing Operations Research algorithms, such as heuristics and
other soft-computing algorithms?
Try Google with Python and your area of
interest. You could well find
Python-based packages which meet your needs.
>
Maybe this is not the right forum, but maybe you can give me some
hints or tips...
Thank you in advance.
Good luck.
Colin W.
On May 17, 5:32*pm, Vicent Giner <vgi...@gmail.c omwrote:
Hello.
I am new to Python. It seems a very interesting language to me. Its
simplicity is very attractive.
However, it is usually said that Python is not a compiled but
interpreted programming language —I mean, it is not like C, in that
sense.
I am working on my PhD Thesis, which is about Operations Research,
heuristic algorithms, etc., and I am considering the possibility of
programming all my algorithms in Python.
The usual alternative is C, but I like Python more.
The main drawbacks I see to using Python are these:
* As far as I understand, the fact that Python is not a compiled
language makes it slower than C, when performing huge amounts of
computations within an algorithm or program.
* I don't know how likely it is to find libraries in Python related to
my research field.
* I know Python is a "serious" and mature programming language, of
course. But I do not know if it is seen as "just funny" in a research
context. Is Python considered as a good programming language for
implementing Operations Research algorithms, such as heuristics and
other soft-computing algorithms?
Maybe this is not the right forum, but maybe you can give me some
hints or tips...
Thank you in advance.
You're hearing from 'impossible and useless'-- neither operations.
'Stacks' are pretty important to Python (there is a Stackless Python,
I understand), which makes persistence a little more handy. It's
still a computer and still a language. You may be asking how well its
best speakers know, and look at that, I can't tell you. Some of the
fundamentals of Python may be unexplored to date, as its from the 90s,
and stacks are elements.
I, for one, will assume you're interested in control operations, which
yes Python has, and control is important. The standard library is a
good size to me (I wouldn't go doubling). There's a ready graphics
module. There are code-primitive literals, including lists -and- a
tuple. I think you're looking for the selling points of dynamic
assignment (a.barproperty= 'unheardof'), typefreeness (a= [2,'bcd']),
dynamic execution (exec('print 2'), which promotes a possibility of
self-referentiality) , type-aware function pointers, variable-length
procedure arguments, and platform independence.
I think you just asked at the right time. Yes that's an impressive
list.
There is one catch to Python, of the importance of which of the powers
that be, I am unaware. But I do know what you are liable to find on
the newsgroup. Now, with thousands of dollars of institution time on
the money, what control? I will be tentatively assuming that you are
not covertly comparing other languages. I don't think you'll like it
if you're unwise.
On May 18, 12:32 am, Vicent Giner <vgi...@gmail.c omwrote:
* As far as I understand, the fact that Python is not a compiled
language makes it slower than C, when performing huge amounts of
computations within an algorithm or program.
First of all: whatever you do, use NumPy for all numerical work (and
possibly Scipy). Remember that Python with NumPy tend to be faster
than Matlab. Anything that applies to Matlab regarding vectorization
for speed also applies to NumPy.
If your program runs too slowly, try to use the psyco jit compiler
first. If that doesn't help, try one of the following:
- use Cython or Pyrex and compile your (modified) Python code
- inline C++ using scipy.weave
- write a function in C and call it using ctypes
- write a function in Fortran and make it callable from Python using
f2py
Usually, only small bottlenecks matter when it comes to overall
performance. It is also notoriously difficult to guess where they are.
Therefore: write everything in Python first, then profile your code to
identify bottlenecks. Only important bottlenecks need to be translated
to Pyrex, C or Fortran. http://www.scipy.org/PerformancePython
* I know Python is a "serious" and mature programming language, of
course. But I do not know if it is seen as "just funny" in a research
context.
Google NumPy, SciPy, Matplolib and Sage.
NASA uses Python to process image data from the Hubble telescope.
Thank you in advance.
On May 17, 7:32*pm, Vicent Giner <vgi...@gmail.c omwrote:
Hello.
I am new to Python. It seems a very interesting language to me. Its
simplicity is very attractive.
However, it is usually said that Python is not a compiled but
interpreted programming language —I mean, it is not like C, in that
sense.
I am working on my PhD Thesis, which is about Operations Research,
heuristic algorithms, etc., and I am considering the possibility of
programming all my algorithms in Python.
The usual alternative is C, but I like Python more.
The main drawbacks I see to using Python are these:
* As far as I understand, the fact that Python is not a compiled
language makes it slower than C, when performing huge amounts of
computations within an algorithm or program.
* I don't know how likely it is to find libraries in Python related to
my research field.
* I know Python is a "serious" and mature programming language, of
course. But I do not know if it is seen as "just funny" in a research
context. Is Python considered as a good programming language for
implementing Operations Research algorithms, such as heuristics and
other soft-computing algorithms?
Maybe this is not the right forum, but maybe you can give me some
hints or tips...
Thank you in advance.
I guess that python is not a good language for that. Algorithms
implemented in plain python are many times slower than C ones
(hundreds ?). In practice, algorithms are written in C and wrapped in
python. I have near zero experience in operations research, but once I
looked for linear programming toolkits for python and IIRC, I only
could find a trivial wrapper for glpk (called pulp).
My opinion: choose compiled or byte compiled languages. Choose the
language paradigm that best suit the algorithms.
what little I know:
The numbers I heard are that Python is 10-100 times slower than C. So use
Python if you can wait 10-100 times longer. Although it won't really be
that slow using numpy and/or psyco.
Python seems to have a really extensive reportoire of modules available for
it. Although I don't know about things in the math field. If what you want
is obscure enough, then you might find it for C/C++ and not Python. You
might find out in a few seconds by googling.
The advantage to Python (other than production time), is that it would be a
lot simpler and more readable simply as a syntax for conveying algorithms.
It would be like pseudo-code... but runnable. ;)
On May 18, 5:32 am, Vicent Giner <vgi...@gmail.c omwrote:
Hello.
I am new to Python. It seems a very interesting language to me. Its
simplicity is very attractive.
However, it is usually said that Python is not a compiled but
interpreted programming language —I mean, it is not like C, in that
sense.
I am working on my PhD Thesis, which is about Operations Research,
heuristic algorithms, etc., and I am considering the possibility of
programming all my algorithms in Python.
The usual alternative is C, but I like Python more.
The main drawbacks I see to using Python are these:
* As far as I understand, the fact that Python is not a compiled
language makes it slower than C, when performing huge amounts of
computations within an algorithm or program.
It is slower than a goodly written C code. C codes might be slower
than Python if the writer of C isn't very familiar with C, on the
other hand Python's implementation of things like list, dictionary,
sets, etc are a very optimized piece of code (some says it's the most
fine tuned implementation in the world) and a sloppily written array/
dict/sets implementation in C might be slower than Python.
* I don't know how likely it is to find libraries in Python related to
my research field.
* I know Python is a "serious" and mature programming language, of
course. But I do not know if it is seen as "just funny" in a research
context. Is Python considered as a good programming language for
implementing Operations Research algorithms, such as heuristics and
other soft-computing algorithms?
Why not ask your peers? AFAIK (since I'm not a researcher, just a high-
school student with a "too much time" to program, I'm not even
familiar with Operation Research), in a Operation Research context (as
I understand it from wikipedia) the important thing is the algorithm
instead of pure speed, and codes are written just to describe the
algorithm you're devising. So any programming language that isn't an
esoteric language (like Whitespace or Brainfuck) would not be
considered a "just funny".
Maybe this is not the right forum, but maybe you can give me some
hints or tips...
Thank you in advance.
On May 18, 11:37*am, Dennis Lee Bieber <wlfr...@ix.net com.comwrote:
On Sat, 17 May 2008 20:25:18 -0700 (PDT), Henrique Dante de Almeida
<hda...@gmail.c omdeclaimed the following in comp.lang.pytho n:
*My opinion: choose compiled or byte compiled languages. Choose the
language paradigm that best suit the algorithms.
* * * * Python IS byte compiled -- that's what .pyc and .pyo filescontain
(strangely though, one must specify a command line argument to get the
"optimized" .pyo, rather than the .pyc with debugging data embedded).
Just to note, currently, "optimized" python code (using -O or -OO)
does very little to make your code goes faster as it doesn't (yet) do
anything but removing docstrings. The -O(ptimized) flags is reserved
to make it possible to add optimizations that might make some features
unavailable or behave differently (such as the docstrings removal that
breaks codes that uses __doc__).
On May 18, 5:46 am, "inhahe" <inh...@gmail.c omwrote:
The numbers I heard are that Python is 10-100 times slower than C.
Only true if you use Python as if it was a dialect of Visual Basic. If
you use the right tool, like NumPy, Python can be fast enough. Also
note that Python is not slower than any other language (including C)
if the code is i/o bound. As it turns out, most code is i/o bound,
even many scientific programs.
In scientific research, CPU time is cheap and time spent programming
is expensive. Instead of optimizing code that runs too slowly, it is
often less expensive to use fancier hardware, like parallell
computers. For Python, we e.g. have mpi4py which gives us access to
MPI. It can be a good advice to write scientific software
parallelizable from the start.
I learned Pascal my first year in college. When I started programming
Matlab, I brought with me every habits of a novice Pascal programmer.
Needless to say, my programs ran excruciatingly slow. I learned C just
to write faster "mex" extensions for Matlab. But eventually, my skills
improved and I found that my Matlab programs did not need C anymore.
It took me almost 3 years to unlearn the bad habits I had acquired
while programming Pascal. It is very easy to blame the language, when
in fact it is the programmer who is not using it properly.
On Sat, 17 May 2008 15:32:29 -0700 (PDT), Vicent Giner
<vg****@gmail.c omwrote:
>Hello.
I am new to Python. It seems a very interesting language to me. Its simplicity is very attractive.
However, it is usually said that Python is not a compiled but interpreted programming language —I mean, it is not like C, in that sense.
I am working on my PhD Thesis, which is about Operations Research, heuristic algorithms, etc., and I am considering the possibility of programming all my algorithms in Python.
Other people have said things about how to use Python
effieiently. Something that seems relevant that I don't
see mentioned:
Are you going to be doing research _about_ the
algorithms in question or is it going to be research
_using_ these algorithms to draw conclusions
about other things?
Most of the replies seem to be assuming the latter.
If it's the former then Python seems like definitely
an excellent choice - when you have want to try
something new it will be much faster trying it
out in Python, when you write up the results
there will be no need for pseudo-code as a
guide to the real code because the Python
will be just about as easy to read as the
pseudo code would be, etc.
>The usual alternative is C, but I like Python more.
The main drawbacks I see to using Python are these:
* As far as I understand, the fact that Python is not a compiled language makes it slower than C, when performing huge amounts of computations within an algorithm or program.
* I don't know how likely it is to find libraries in Python related to my research field.
* I know Python is a "serious" and mature programming language, of course. But I do not know if it is seen as "just funny" in a research context. Is Python considered as a good programming language for implementing Operations Research algorithms, such as heuristics and other soft-computing algorithms?
Maybe this is not the right forum, but maybe you can give me some hints or tips...
Thank you in advance.
David C. Ullrich This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Joe Cheng |
last post by:
I'm curious about something... many Artima.com members who have a Java
background and learned Python have come to the conclusion that Java and
Python are highly complimentary languages. They would never consider
filling the place Java has in their toolbox with Python, but recognize there
are many tasks where it really pays to add Python to the mix.
I want to ask you hard-core c.l.p Pythonistas: Do you use Python for
everything? (and...
|
by: Stephen C. Waterbury |
last post by:
This seems like it ought to work, according to the
description of reduce(), but it doesn't. Is this
a bug, or am I missing something?
Python 2.3.2 (#1, Oct 20 2003, 01:04:35)
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> d1 = {'a':1}
>>> d2 = {'b':2}
>>> d3 = {'c':3}
|
by: Lad |
last post by:
Is anyone capable of providing Python advantages over PHP if there are
any?
Cheers,
L.
|
by: xeys_00 |
last post by:
I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it's
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was...
|
by: abhinav |
last post by:
Hi guys.I have to implement a topical crawler as a part of my
project.What language should i implement
C or Python?Python though has fast development cycle but my concern is
speed also.I want to strke a balance between development speed and
crawler speed.Since Python is an interpreted language it is rather
slow.The crawler which will be working on huge set of pages should be
as fast as possible.One possible implementation would be...
| |
by: hacker1017 |
last post by:
im just asking out of curiosity.
|
by: Xiao Jianfeng |
last post by:
Hi all,
I am looking for a genetic algorithms package for Python.
I have googled the web before posting and found some links. The link of
pygene(http://www.freenet.org.nz/python/pygene) cannot be opened.
I also tried the recipe on ASPN, but it is too simple for my
application, and the ga model in SciPy, which is in testing in the
"sandbox".
|
by: efrat |
last post by:
Hello,
I'm planning to use Python in order to teach a DSA (data structures
and algorithms) course in an academic institute. If you could help out
with the following questions, I'd sure appreciate it:
1. What exactly is a Python list? If one writes a, then is the
complexity Theta(n)? If this is O(1), then why was the name "list"
chosen? If this is indeed Theta(n), then what alternative should be
used? (array does not seem suited for...
|
by: Jens |
last post by:
I'm starting a project in data mining, and I'm considering Python and
Java as possible platforms.
I'm conserned by performance. Most benchmarks report that Java is
about 10-15 times faster than Python, and my own experiments confirms
this. I could imagine this to become a problem for very large
datasets.
How good is the integration with MySQL in Python?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |