Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Multi-processing - problem with running multiple *.py files at the same time
Post: RE: Multi-processing - problem with running multip...

(Sep-12-2018, 12:15 AM)woooee Wrote: The code I posted, now modified to print each process that is still running, will tell you what is running. Post back the results of the code I posted above. It...
Antonio General Coding Help 5 3,832 Sep-12-2018, 02:19 AM
    Thread: Multi-processing - problem with running multiple *.py files at the same time
Post: RE: Multi-processing - problem with running multip...

I check the task manager and it's only one core of the CPU that is working; plus the time is 5 times more than running a single file (I have 5 files in the loop as you see). The point is, how do I run...
Antonio General Coding Help 5 3,832 Sep-11-2018, 08:32 PM
    Thread: Multi-processing - problem with running multiple *.py files at the same time
Post: Multi-processing - problem with running multiple *...

Hi there, I have multiple *.py files that I need to run concurrently. Each file looks like this: def my_function(file): # my codeThen I have written this to run my files simultaneously: import...
Antonio General Coding Help 5 3,832 Sep-11-2018, 04:16 AM
    Thread: Draw a square-aspect log-linear plot via matplotlib
Post: RE: Draw a square-aspect log-linear plot via matpl...

(Jun-19-2018, 05:41 PM)snippsat Wrote: Most change so line 5 where fig is defined comes first,and pylab is no longer recommended. #from pylab import * # No import matplotlib.pyplot as plt x = np.ex...
Antonio Data Science 4 8,449 Jun-19-2018, 05:57 PM
    Thread: Draw a square-aspect log-linear plot via matplotlib
Post: RE: Draw a square-aspect log-linear plot via matpl...

(Jun-19-2018, 07:31 AM)scidam Wrote: Using numpy (it is a part of pylab/matplotlib) you can do any conversion of the data manually, e.g.: from pylab import * x = np.exp(np.linspace(0, 5, 10000)) y ...
Antonio Data Science 4 8,449 Jun-19-2018, 04:57 PM
    Thread: Draw a square-aspect log-linear plot via matplotlib
Post: Draw a square-aspect log-linear plot via matplotli...

So I have a plot with logarithmic x axis but linear y axis, and I want the plot to be square-aspect, but when I use plt.axis('equal') it does not work and I get the following error: Error:UserWarning...
Antonio Data Science 4 8,449 Jun-19-2018, 03:08 AM
    Thread: Write a for loop on list of lists without changing the shape of the main list
Post: RE: Write a for loop on list of lists without chan...

(Jun-18-2018, 10:51 PM)gontajones Wrote: When you access mylist[i][j] it returns the single item at that position. Try something like this (if you really need to loop into every item): newlist = []...
Antonio General Coding Help 3 3,787 Jun-19-2018, 01:55 AM
    Thread: Write a for loop on list of lists without changing the shape of the main list
Post: Write a for loop on list of lists without changing...

So I am new to python and am having difficulties on writing an efficient for loop on a list of lists. I have a list called "mylist" and I need to store the values of the first column of sublists, and ...
Antonio General Coding Help 3 3,787 Jun-18-2018, 10:17 PM
    Thread: Get max values based on unique values in another list - python
Post: RE: Get max values based on unique values in anoth...

(Jun-12-2018, 10:00 AM)volcano63 Wrote: (Jun-12-2018, 09:32 AM)Mekire Wrote: Hmm, I was looking for something like that and didn't find what I need. I'm surprised there isn't a sort of findgroups ...
Antonio Data Science 8 8,451 Jun-12-2018, 03:21 PM
    Thread: Get max values based on unique values in another list - python
Post: Get max values based on unique values in another l...

In a numpy.ndarray (2d) I want to calculate the maximum of corresponding values (second column) of repetitive values (first column) in the array. Like if the array is this: sys_func = array([[126. ...
Antonio Data Science 8 8,451 Jun-12-2018, 02:20 AM
    Thread: Execute a file within another Python file in Spyder
Post: Execute a file within another Python file in Spyde...

So I need to run a file (file_1.py) within another file (file_2.py), and use the variables/outputs that are created via file_1.py in file_2.py! In file_2.py, I have tried the followings: import file_...
Antonio General Coding Help 1 6,041 Jun-11-2018, 06:46 PM
    Thread: Why A[0] and A[0:1] have different sizes?
Post: RE: Why A[0] and A[0:1] have different sizes?

(May-06-2018, 01:22 PM)killerrex Wrote: I imagine array is numpy.array. The recommended way to use numpy is: import numpy as np candidates = np.array( [[1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1,...
Antonio Data Science 2 2,573 May-07-2018, 04:37 PM
    Thread: Why A[0] and A[0:1] have different sizes?
Post: Why A[0] and A[0:1] have different sizes?

So I have this: candidates = array([[1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,...
Antonio Data Science 2 2,573 May-05-2018, 10:31 PM
    Thread: Spyder IDE - make variable explorer to follow the color scheme of the Editor
Post: Spyder IDE - make variable explorer to follow the ...

I do not know why but when I change the color scheme of the spyder editor (I have the latest version installed and I do it through preferences -> syntax coloring), the variable explorer's color rem...
Antonio General Coding Help 0 5,465 May-05-2018, 10:20 PM
    Thread: How to avoid reloading modules in python
Post: RE: How to avoid reloading modules in python

(May-04-2018, 09:03 PM)nilamo Wrote: I can't imagine it'd cause any issues in your code, unless you do it a lot (a LOT), and then it might slow your program down a bit. I also can't imagine how that...
Antonio General Coding Help 5 21,037 May-04-2018, 09:16 PM
    Thread: How to avoid reloading modules in python
Post: RE: How to avoid reloading modules in python

(May-04-2018, 08:26 PM)nilamo Wrote: Unless you're doing something wacky with the importlib module, you can't reload modules. What's the whole warning/error message? Is there a traceback? It's actu...
Antonio General Coding Help 5 21,037 May-04-2018, 09:00 PM
    Thread: How to avoid reloading modules in python
Post: How to avoid reloading modules in python

I am getting the warning: Error:"reloaded modules: chromosome_length"Chromosome_length is actually a function that I am calling in another *.py file via the following: from chromosome_length import c...
Antonio General Coding Help 5 21,037 May-04-2018, 07:51 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020