- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
24 Posted Topics
You may want to start using biopython as it has many classes and methods for handling sequence data, especially from a fasta-formatted file. It may already do some of the work for you.
Ya, all of the functionality would need to be on google's end. They'd have to offer a SDK in python for their docs API. They have something like this for Android and python: https://thp.io/2012/europython/ But if you can't find the SDK in python for google docs, you may be out …
Personally I think it's important to start using libraries that are the most suited to your goals. Are you a web developer? Then you should start learning web development frameworks in python (flask, django etc..). Are you a scientist? Then let me save the pain of learning that doing math …
This came up in the related articles: http://www.daniweb.com/software-development/python/threads/459002/python-how-to-ask-user-for-text-input
http://scikit-image.org/docs/0.9.x/auto_examples/plot_convex_hull.html
I don't really know what you're asking specifically, but have you looked into the "requests" package? I don't know much about web frameworks, but if might help you with handling requests.
Hi, I built a Polygon() class that originally only was initialized with veriticies: Polygon(verts=(1,2,3,4) But as the code evolved, I added a few @classmethods to construct the Polygon from other inputs. For example: Polygon.from_center(center=(1,2), length=5) Now my problem is that I'm trying to find the canonical way to choose which …
Hmm, if you want to assign by value, why not just store your lists in a dictionary. IE, a dictionary of lists. Something like: dict = {} dict['list1'] = ['foo', 'bar'] dict['list2'] = ['baz', 'qi']
IMO, you ought to always just do "from __future__ import division" or make sure that you are working soley with ints. The only time I think it would be necessary to maintain ints when possible is if you're doing very intense computations and you can't afford the extra memory it …
Scikit image all the way: http://scikit-image.org/
Just FYI, when you need to access both the index and value in an interation, consider using "enumerate": In [1]: mylist = ['foo', 'bar', 'baz'] In [2]: for idx, value in enumerate(mylist): ...: print idx, value ...: 0 foo 1 bar 2 baz
Hi. I have a Foo class that stored a dictionary attribute called _data. I'd like the Foo class to have a dictionary interface, and defer most basic dictionary operations down to the _data attribute. I am currently overwriting the magic methods one by one: def __getitem__(self, item): return self._data[item] def …
I don't if I'd think about them in terms of sizes... arg = required arguments of the function. Function will error without them. *args = Additional non-keyword arguments that are not required for function to run. **kwargs = additional keyword arguments that are not required. *args and **kwargs are options.
When you say application, does it need to be interactive, or just accessible through the python shell? For example, do you have to run the program, and it will pause and prompt the user for commands, or can you just define some classes, and then modify them through the terminal? …
Each time you do append, you're adding the entire object, which in this case is a list. Therefore, you are going to be recursively adding lists. You could try initializing the item/internal empty lists in the class __init__ method instead of each time leaves_internals is called. Then replace your append …
You could plot each line in a different color and then in the legend, indicate some distinguishing attribute of each line. This question is probably better suited for the matplotlib mailinglist/forum, as you're more likely to find people who are familiar with the package.
Pandas has a very good mailing list, perhaps you should consider joining it and posting this question there.
Also, if this is just an exercise, then doing it with native python datastructures (like lists) is a nice way to go. In reality, you should use numpy to make a matrix. It's a library for just this, and will be about 1000 times faster than a matrix made out …
Hi guys, I have a code that intercepts calls to methods via __getattr__. Something like: def __getattr__(self, attr, *fcnargs, **fcnkwargs): out=getattr(self._df, attr)(*fcnargs, **fcnkwargs) etc... My goal is when a user calls a method, if it is not a method of self, the program attempts to run it on one of …
Hi all, I have a class with a variety of methods, for example: class Foo(obj): def meth_a: ... def meth_b: ... In reality, Foo may have 50 or more methods. And for various reasons, I cannot subclass Foo. I'm using Foo in a composition class with some added functionality. Let's …
I think a program to represent a game is a good introduction to object oriented programming. When you find yourself defining several global variables that are shared between a bunch of functions, you should build a game class. Imagine you wanted to increase the complexity of your game. At some …
Ya, pickle will allow you to save your classes to disk. Once you close python, objects are removed from memory so it doesn't make much sense to talk about restoring unless you've saved it to your harddisk.
This is a nice example. It might also be really great to have a numpy version of this.
You'll have better luck posting on the matplotlib forums. Something tells me that time_list[i] is not actually a single value, but is likely an interable (tuple or list). I'd also recommend using pandas, importing the data into your dataframe, and using a TimeIndex as the label axis. If you're working …
The End.