Having done similar, the options are (depending on the dataset):
1: Python to read, clean and classify data, then R to do the analysis (e.g.
regression analysis)
2: Python to read, clean and classify data, and python for the analysis
3: All in R
If you want to use Python for the analysis, most
Use the str() function.
M
On Thu, 15 Dec 2016, 07:56 Bryon Adams, wrote:
> Is there a way to force my argument to always be a string before
> entering the function? Else, is there a better way to go about this? In
> whatever program I write, I could change what I want as input to be a
> string
Dear Tutors,
I am looking for some advice. I have some data that has three dimensions to
it. I would like to store it such that one could manipulate (query/ update/
etc.) by dimension - so it would be feasible to ask for all of the data
that shares a value in d1, or iterate over all of the values
No, but in his defence, I can imagine someone reading the dissertation
and asking for a citation..
(Apologies for TP).
M
On 15/03/2016 18:43, Alan Gauld wrote:
On 15/03/16 11:45, Holderness, Ellie wrote:
How do I cite Python for my dissertation bibliography?
I used version 3.5.1.
I'm not
Can someone recommend an open-source editor for all 3 platforms?
M
On Wed, 2 Mar 2016 21:37 Ben Finney, wrote:
> Ben Finney writes:
>
> > Short of [the heavyweights Vim and Emacs], I'd still recommend a
> > community-owned, free-software, highly flexible programmer's editor.
> > If you're on G
I teach an introductory programming course to medical students (and a few
doctors).
I would look at Sublime Text 2 if one Windows/ Mac. Has a 'nag' screen to
remind you to buy, but feels simple enough when you start it.
M
On Wed, 2 Mar 2016 19:50 Ben Finney, wrote:
> Lisa Hasler Waters writes
Just as a note - you are not the only person caught out by this - it is a
very common slip.
I wonder whether it would be worth adding a more explicit line about this
in the Python Docs?
Matt
On Wed, 3 Feb 2016 16:13 Ek Esawi wrote:
> Hi All
>
>
>
>
>
> I have a code that reads a csv file via D
This is a problem I have come up against often, and I don't think I have a
good answer, so if anyone else does, I would be glad to hear it!
I would be tempted to generate a 'test data.CSV" file, and run the tests on
that. It means that as you write the code, and find some edge cases, you
can alter
Personally I would start with Python 2.7, and start with simple scripts.
The standard library in Python is very "wide", and having a good
understanding of what is already there is very useful.
As to GUI/ Web/ etc. - I think it depends on what you want to do. However,
you will need the basics befo
Dear Rob,
This caught me out as well for a long time.
As I understand it, csv.reader is a file-reader, which iterates ONCE
over the file. There may be more elegant solutions, but I do:
import csv
ifile = open('test.csv', "r")
reader = csv.reader(ifile)
inData = []
for row in reader:
i
On 12/10/2011 18:21, Anna Olofsson wrote:
Hi,
I'm a beginner at python and I'm trying to extract a specific column
from a txt file ( see attached file).
In the attached file I want to extract the entire column/pph2_prob
/(i.e. column 16). But I want to get all the values from that column
wi
Dear Ara,
I have been working on something similar.
In the end I used a dictionary for each line in the file, and stored
data from each file in a different set. I then matched using one (or
more) element from each dictionary. This is really very close doing a
join in a database, though, and i
Dear All,
I'm trying to write something to calculate rule priorities, based on
their provenance (ultimately I'm after a lexicographic ordering)
I have a set of terms (the provenances) I'm try to sort. I've done it by
associating each possible set of terms with a dictionary, and then using
the
Dear List,
I've written a small script to extract the definitions from my thesis,
and output them as a .tex file, which works ok but I have a small problem.
The input is done by specifying a directory, and using glob to find the
".tex" filenames.
However, I want to process them so that they ar
Dear All,
I know this has come up loads of times before, but I'm stuck with what
should be a simple Regex problem. I'm trying to pull all the definitions
from a latex document. these are marked
\begin{defn}
\end{defn}
so I thought I'd write something like this:
filename = '/home/acl_home/P
Dear Etienne & Carlos,
Thanks so much for that - much clearer!
I guess the next question is _how_ do you use it intelligently? I'm
interested because I'm trying to put stuff into a db using sqlobject.
Obviously one way would be:
class MyClass:
def __init__(self,**kw)
self.proper
Dear All,
I have learnt to do bits of python, but one of the things I cannot get
my head around is the *args, **kwargs syntax.
I have tried reading stuff on the web, and I have a copy of the python
cookbook (which uses it as a recipe early on) but I still don't
understand it.
Please could som
You might also want to have a look at DABO; I don't know how well it
work on a handheld, though.
http://dabodev.com/about
Matt
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
FC4 (the latest finished one) has python 2.4.1 as part of the distro (I
think RedHat actually use python for some of their scripts).
Just pull up a terminal and type 'python' and you should get the
prompt...
If you _are_ running FC4 and have more probs, feel free to drop me a
line. at matt at mwi
I think the Wiki's a great idea.
del.icio.us already has a Python tagged page: http://del.icio.us/tag/python
Other pages I use are:
http://mechanicalcat.net/pyblagg.html
http://www.planetpython.org/
I've added a couple of things to the Wiki - SQLObject and RSPython
Matt
Dear Alan,
I haven't used it, but I've looked through it, and it looks v.
interesting. One of the things I like is that it glues lots of different
bits together (I came across it while looking at SQLObject), and so
benefits from their advances.
I was a bit surprised that you hadn't
come across it
I don't know if this will do anywhere near what you want...
http://swiginac.berlios.de/
is a set of Python bindings to GiNaC, which handles symbolic maths in
C/C++.
Matt
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/t
The suprising thing about Latin Perl is that it's more
readable than normal Perl
Matt
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Mea Culpa, Mea Culpa, Mea Maxima Culpa (or, MCMCMMC to repeat my sin of
poly-acronymony.
Semantic Web - (loosely) the idea of incorporating semantic information
in the WWW, so it becomes machine understandable (rather than just
parsable).
CWM is Tim Berners-Lee's (and others) tool to handle ontol
Dear List,
Does anyone know of any python semweb tools? I'm especially interested
in tools to build and handle ontologies. I've come across CWM (built by
Tim BL) but not that much else. I'd be really interested in anything
that can interface with a DIG reasoner.
Really, I'm looking for a pythonic
Dear List,
Slightly off topic, but could someone explain/ point me to a URL that
explains how one might use Python with Mono (I guess it would be
IronPython, rather than CPython), and what advantages it might give you
(apart from a possible speed up of IronPython vs. CPython). I'm
especially inter
Dear All,
Just a note: When the next question about "which GUI for Python" comes
around (and I should plead guilty to having asked a few times) I thought
that the Dabo framework, which wraps wxPython in a nicer API would be
worth pointing to.
And even if the question didn't get asked, I thought p
There's some extra info here:
http://comments.gmane.org/gmane.comp.python.announce/5658
HTH,
Matt
--
Dr. M. Williams MRCP(UK)
Clinical Research Fellow
Cancer Research UK
+44 (0)207 269 2953
+44 (0)7834 899570
http://acl.icnet.uk/~mw
http://adhominem.blogspot.com
Dear List,
I've got a few general programming (not really specific to python,
although you're all so helpful, I thought I'd ask here). I understand
some of these are a bit long, so if you could just point me to some
resources, I'd be very grateful.
1: I need to create objects that have variable l
Dear List,
I'm stuck on trying to write a generic 'report' function:
Class SomeClass:
def __init__(self,a,b):
self.a = a
self.b = b
def report(self):
for i in dir(self):
print self.i
This is where I run into problems: How do I return all of the varia
IMHO, as regards the book using wxPython, rather than Tkinter:
I've failed to get Tkinter to compile on several installs,
whereas I can usually get wxPython to work. Also, wx seems
to be better documented.I know it's not ideal to pick one
platform, but I would guess that wx would be a reason
Dear List,
I'm trying to clarify something about accessing variables.
If I have ONE.py file with some variable a, and ONE imports TWO, which
has a variable b, can TWO access variable a (I don't think so, but I
just thought I'd check).
I guess the way round this is just to make some classes & obj
Dear List,
Could someone explain how, in very general terms, one would use python
to wrap some C libraries/ API.
I ask because there are a few bits of C software that look quite
interesting, and I know that Python can be used to wrap the C - but how
does it work?
Thanks,
Matt
Dear List,
Thanks for all the advice! Obviously, I'm still a bit torn, but some of
the ideas looked good.
In terms of spec, the DB can be fairly simple (single access, etc.).
Lower dependency on other libraries is good. Also, it needs to be cross-
platform.
The problem (I have) with SQL-type DB
Dear List,
I've been looking for a simple python based DB for a fairly simple app.
Only a single user, single access needed, but with a dynamic structure
(which needs to be extensible very easily).
Having googled and read some stuff, I seem to come down to a choice
between KirbyBase (very nice an
I've used both PyDev and Wing IDE.
PyDev seems good, and is getting better.
Wing is pay-for (although only $40 or so), but can be trialled. I thought
it was good, but had a huge problem trying to get it to play with a C library
I was using...
I've never managed to get Boa-Constructor to run...
Dear List,
Does anyone know of a Python FTP GUI tool ? Preferably based around
pyGTK+ ?
I've had a look (Google, vaults of Parnassus, etc.) but haven't found
one.
If there isn't one, then would people consider it a useful project for
newbie programmers (like myself). There have often been questi
Dear List,
Thanks for the help with the previous problem - now all solved!
I have a question about accessing lists. I'm trying to do something to
each item in a list, and then assign it back into the list, overwriting
the old value. However, the first loop here doesn't work, whereas the
second lo
of my slowness:
This is my first programming language
I couldn't get the tutor list to work for ages - until I realised I was
sending all the desperate pleas for help to tutor-request. Perhaps there
is no hope..
Matt Williams
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I would recommend KirbyBase as a quick starter - it's nice and simple,
and outputs text files, so you can always check things manually.
http://www.netpromi.com/kirbybase.html
Matt
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/
I'd be interested,
Matt
On Fri, 2004-12-17 at 11:01, [EMAIL PROTECTED] wrote:
> Send Tutor mailing list submissions to
> [EMAIL PROTECTED]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with
Further to my previous post, please find some code below:
Hope this helps,
Matt
#Complex number Roots
#Matt Williams 9.12.04
import math
number=complex(0.5,0)
n=float(3)
size=math.sqrt((number.real**2)+(number.imag**2))
arg=math.radians(360/n)
root=1/n
modulus=size**root
theta=float(0
Dick Mores wrote:
My trusty $10 Casio calculator tells me that the 3 cube roots of 1 are:
1, (-.5 +0.866025403j), and (-.5 -0.866025403j), or thereabouts. Is
there
a way to do this in Python?
I think the neatest approach might be to consider that the n-complex
roots form at equal angle around
Dear Tutor-list,
I'm sorry for this appallingly dumb question, but I'm having a little
problem with objects.
I've written a class, with some methods. I then want to be able to call
the class repeatedly, to create some objects. The number of objects, and
some of their initialisation parameters nee
44 matches
Mail list logo