|
I've just started using rpy2 with Python. I've installed it and am able to do basic things, like call R's plot function from inside Python. For everything I've done, I've used import calls like:
import rpy2 import rpy2.robjects
From robjects I can do ...
Started by Andy Hall on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use the normal library() command from robjects.r to load a library in rpy2 2.0.x:
from rpy2.robjects import r r.library("lattice") r.library("ggplot2")
Or you can upgrade to the 2.1 alpha... .
You're probably still using 2.0.x.
Packages is new in 2.1.
|
|
How can I make sure that my Python script, which will be doing some XML parsing, will Just Work with Python 2.4, 2.5 and 2.6?
Specifically, which (if any) XML parsing library is present in, and compatible between, all those versions?
Edit : the working...
Started by David Wolever on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Its syntax is much.
However, if I were you, I would strongly consider using ElementTree which is available in Python 2.5 and later.
You can use minidom
minidom is available in Python 2.0 and later.
|
|
How can I scan a bunch of Microsoft Word (2003) documents? I am searching for a certain phrase in the documents and want to return the file names of those which contain the phrase.
A code sample would be especially helpful.
Started by Josh Stodola on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
Are basically a zip file and inside the zip file contains a bunch of xml files that contains the contents python code using (sorry, I don't know much .Net, but the COM functions will be similar)
I'm guessing you.
|
Ask your Facebook Friends
|
Ok, I have a group of objects which I am creating a class for that I want to store each object as its own text file. I would really like to store it as a Python class definition which subclasses the main class I am creating. So, I did some poking around...
Started by Jonathanb on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
We use Jinja2 to fill in a ....
(I linked to the Python 3 version because file).
However, you can also generate Python executable code at runtime using the ast library.
This is pretty much the best way to generate Python source code.
|
|
How do I parse sentence case phrases from a passage.
For example from this passage
Conan Doyle said that the character of Holmes was inspired by Dr. Joseph Bell, for whom Doyle had worked as a clerk at the Edinburgh Royal Infirmary. Like Holmes, Bell ...
Started by ramdaz on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
=== Ned B.
Output:
C:\junk\so>\python26\python extract_names.py *** text: Conan Doyle said tha ...
|
|
Yesterday, I asked this question and never really got an answer I was really happy with. I really would like to know how to generate a list of N unique random numbers using a functional language such as Ruby without having to be extremely imperative in...
Started by Esteban Araya on
, 14 posts
by 14 people.
Answer Snippets (Read the full thread at stackoverflow):
How about....
Hmm...
Here's what I think you are looking for in Python:
>>> import random >>> the while loop.
Python with Numeric Python:
from numpy import * a = random.random_integers(0, 100, 5) b = unique are after.
|
|
Dear All,
I have written a bunch of Perl libraries (actually Perl classes) and I want to use some of them in my Python application. Is there a natural way to do this without using SWIG or writing Perl API for Python. I am asking for a similar way of PHP...
Started by holydiver on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Thereafter, the reference implementation of ....
You've just missed a chance for having Python running on the Parrot VM together with Perl, the CPython implementation will terminate with the release of Python 2.6.2 and 3.0.2.
Stability.
|
|
I have quite a lot of music files but their title attributes have the track numbers infront of them, like 01.TrackName, 02.TrackName. What is the best way to strip off integers from the file attributes?
Edit: I am using windows and all music files are...
Started by Jaelebi on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Another option would be to use python with the id3 tag library (I don't remember its name...)
Edit: For example http://www.mp3tag.de/en/
Mutagen : Id3 tag library for python..
Regexes.
|
|
Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?
Started by jodonnell on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Python is Not Java Java is Not Python, either One key difference in Python is significant whitespace and makes much more sense than ; ....
The two languages (mostly about philosophy/mentality rather than specific language features) .
|
|
What makes Python stand out for use in web development? What are some examples of highly successful uses of Python on the web?
Started by jjclarkson on
, 12 posts
by 12 people.
Answer Snippets (Read the full thread at stackoverflow):
Site authors write code in (a slightly restricted subset of) ....
This is because there are bunch of different tools for doing web development with PythonCertainly one successful use of Python on the web is Google App Engine .
Is higher.
|