Posts
 
Reputation
Joined
Last Seen
Ranked #457
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
87% Quality Score
Upvotes Received
17
Posts with Upvotes
14
Upvoting Members
11
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
5 Commented Posts
~98.9K People Reached
Favorite Tags
Member Avatar for Iceman10284

You need to post an attempted effort before anyone will help you with homework.

Member Avatar for booicu
-1
7K
Member Avatar for BigPaw
Member Avatar for jamison234

Your best bet is to load all the datafiles into a pandas dataframe. This is the de-facto structure for handling labeled array data, and also has a ton of utilities for data manipulation ESPECIALLY timestamp. post an example of one of your files, maybe the first 30 lines, including header, …

Member Avatar for hughesadam_87
0
4K
Member Avatar for shayallenhill

The cached property is definatly the best suggestion. If not using that, I would get in the habit of using try: except in these situations. That is syntactially simple and very common, so others reading your code will be able to deduce your intent from the code.

Member Avatar for hughesadam_87
0
397
Member Avatar for hotblink
Member Avatar for hughesadam_87
0
387
Member Avatar for fantasma.delespacio.773

I can't really digest the entirety of your code just by looking at it, but another thing you might wanna look into is the polymonial support in numpy. There are some functions, mostly for fitting polynomicals of Nth order to other curves, that might be useful to you. For example: …

Member Avatar for hughesadam_87
0
165
Member Avatar for Wire.Crisis

outstring=' '.join([str(i) for i in range(0,105,5)]) file.write(outstring) Also, it's a good habit not to use the word "file" as this is a python reserved file. I'd recommend outfile or just o.

Member Avatar for Lardmeister
0
403
Member Avatar for weblover

If you use numpy, then you want to avoid iterating item by item. In fact, the whole reason to use numpy, is that you don't have to do this. If you do do this, you get no speed increase over plain python (the speed increase is about 1000-fold btw). You …

Member Avatar for weblover
0
296
Member Avatar for Inshu
Member Avatar for Schol-R-LEA
0
205
Member Avatar for hughesadam_87

Hi guys, This feels like something that should be possible in Python, and something that I feel like I should know how to do. Image I have a list of numbers: items=[10,20,30] Let's say I wanted iterate over them and define two new variables, a and b. a=[] b=[] for …

Member Avatar for hughesadam_87
0
177
Member Avatar for padton

Can you put all the zipped values into its own list. `allvalues=[zip(ar1.values, br1.values, ar0.values, br0.values), zip(ar2.values, br2.values, ar1.values, br1.values) ... etc]` Then iterate over just this: for zippedvals in allvalues: for w,x,y,z in zippedvals: val = (sqrt((w.data**2)+(x.data**2)))-(sqrt((y.data**2)+(z.data**2))) files[0].write(('%6.20f\n') % (val))

Member Avatar for Gribouillis
0
229
Member Avatar for kRaeTwin
Member Avatar for woooee
0
1K
Member Avatar for nUmbdA

I noticed a few things. First, there's no reason to put the entire code into a function (eg main). This is fine, but not mandatory. There's a special line at the bottom of your code that you should add so that if this program is called as an import from …

Member Avatar for glenwill101
0
587
Member Avatar for hughesadam_87

Hi guys, I am running a costly simulation and trying to optimize the output. I'd have a fixed range over which the parameter of interest can vary, and about 100 values it can take in between. We know the result we are looking for and want to find the parameter …

Member Avatar for hughesadam_87
0
162
Member Avatar for hughesadam_87

Hi guys, I've downloaded 2 cached_property implementations from the internet and both did not work correctly for my programs. Does anyone here used a cached_property function that works really well and could share with me?

Member Avatar for hughesadam_87
0
242
Member Avatar for mahmoud.eddeen

Install ubuntuu. It is a free oerating system, basically virus free and better than windows.

Member Avatar for nand.prist
0
224
Member Avatar for littleEuler

Also, python is going to round (9/5) to 2 since these are integers. Get in the habit of using floats: (9.0/5.0)

Member Avatar for hughesadam_87
0
108
Member Avatar for jim.lindberg1
Member Avatar for hughesadam_87
0
135
Member Avatar for crishein14

If you're using linux, this may be handled more simply with a bash script.

Member Avatar for M.S.
0
169
Member Avatar for lewashby

Bump tot he above poster, it is most certainly better to store variables so they may be accessed by attribute (eg movie.director)

Member Avatar for ~s.o.s~
0
145
Member Avatar for hughesadam_87

Hi, I'm having some difficulty reading in boolean values from a file, particularly false values. Python can understand false values as empty strings, as well as a few other ways. For example: In [43]: bool(0) Out[43]: False In [44]: bool(False) Out[44]: False In [45]: bool('') Out[45]: False The problem is, …

Member Avatar for woooee
0
894
Member Avatar for nishu..

Are you sure that's something you can do out of the box with the software development kit provided by google? I know google provides a Python scripting layer for Android development, so that might be a good place to start.

Member Avatar for hughesadam_87
0
175
Member Avatar for hughesadam_87

Hi, I am trying to create the most general function possible to test if an object passed into it has mutability or not. With some prior help from pytony, it seemed that the best way to do this is to try to set and attribute. If the attribute can be …

Member Avatar for hughesadam_87
0
4K
Member Avatar for ceck30s

I would starting working with the Enthought Tool Suite. Their TraitsUI (and now the new Enaml framework) are worth investing the time into. They allow for really simple GUI's that are interactive from the door. In your case, it would be as simple as having a checkbox and when the …

Member Avatar for hughesadam_87
0
333
Member Avatar for TrustyTony

Well that just blew my mind. Is it actually quicker to define the pali() function than it would be to just put that expression into the generator expression? EG max((a*b, a, b) for a in range(999, 100, -1) for b in range(a, 100000//a, -1) if str(a*b))==str(a*b)[::-1]) I ask because sometimes …

Member Avatar for hughesadam_87
0
556
Member Avatar for python1956

Can't you do: list_of_lists=[list(x) for x in list_of_tuples] This should make a list of lists; however, as PyTony said, this step should not be necessary for implicit compatibility w/ numpy.

Member Avatar for vegaseat
0
539
Member Avatar for ryantroop

I know that[ HDF5 for python](http://alfven.org/wp/hdf5-for-python/) understands the concept of chunking and may be a good place to start if you're interested in learning more about handling large data.

Member Avatar for hughesadam_87
0
178
Member Avatar for neriahfred

Not sure how to do this but for handling the images, start with PIL (python image library). PyAudio is probably the goto package for handling audio in python and not sure about video.

Member Avatar for hughesadam_87
0
191
Member Avatar for imixkumuku

If you're using a unix-based operating system (aka not windows), you can use the subprocess module to execute shell commands. In effect, you would run latex at the command line through Python. http://docs.python.org/library/subprocess.html Looks like you are using windows though so I'm not quite sure. Sorry

Member Avatar for hughesadam_87
0
1K
Member Avatar for ProNewb

Don't use "List" as your variable name, this is a reserved python keyword. Try replacing it with something like "mylist". Also, python's list have building count features so you can do something like: for x in mylist: print x, mylist.count(x)

Member Avatar for ProNewb
0
174