Dear all,
My code consists of a graphical user interface written in PySide. This GUI will
then call a FORTRAN executable.
I run the FORTRAN executable using the following lines in my script:
curPath = os.path.dirname(os.path.realpath(__file__))
execPath = os.path.join(curPath, "myFORTRAN.out"
Dear all,
I am trying to compare the contents of two binary files. I use python 3.6
filecomp comparing same name files inside two directories.
results_dummy=filecmp.cmpfiles(dir1, dir2, common, shallow=True)
The above line works for *.bin file I have in both directories, but it does not
work
Hi Chris and others,
I have re-designed my user interface to include layouts and now it fits the
screen perfectly.
Thanks a lot for all your help on this thread,
Best
--
https://mail.python.org/mailman/listinfo/python-list
Dear all,
I have a software code that is written in python and has a structure like this.
package/
run_my_gui.py#gui
sub_package/
main.py
sub_sub_package/
__init__.py
A.py
B.py
C.py
All the imports in main.py are absolute and look lik
Dear all,
I have an ASCII file (f1) with 100M lines with columns x,y,z ( new data points)
and then I have a second ASCII file (f2) with 2M lines with columns x,y,z and
VALUE (v10).(known data points). I need to interpolate f1 over f2, that is I
need to have values for v10 for all coordinated
Hi all,
Writing my ASCII file once to either of pickle or npy or hdf data types and
then working afterwards on the result binary file reduced the read time from
80(min) to 2 seconds.
Thanks everyone for your help.
--
https://mail.python.org/mailman/listinfo/python-list
Hi all,
Let me update my question, I have an ascii file(7G) which has around 100M
lines. I read this file using :
f=np.loadtxt(os.path.join(dir,myfile),delimiter=None,skiprows=0)
x=f[:,1]
y=f[:,2]
z=f[:,3]
id=f[:,0]
I will need the x,y,z and id arrays later for interpolations. The prob
Hi,
I have a huge ascii file(40G) and I have around 100M lines. I read this file
using :
f=np.loadtxt(os.path.join(dir,myfile),delimiter=None,skiprows=0)
x=f1[:,1]
y=f1[:,2]
z=f1[:,3]
id=f1[:,0]
I will need the x,y,z and id arrays later for interpolations. The problem is
reading the file t
Hi,
I have a question about data interpolation using python. I have a big ascii
file containg data in the following format and around 200M points.
id, xcoordinate, ycoordinate, zcoordinate
then I have a second file containing data in the following format, ( 2M values)
id, xcoordinate, ycoor
On Monday, October 31, 2016 at 8:03:53 PM UTC+1, MRAB wrote:
> On 2016-10-31 17:46, Heli wrote:
> > On Monday, October 31, 2016 at 6:30:12 PM UTC+1, Irmen de Jong wrote:
> >> On 31-10-2016 18:20, Heli wrote:
> >> > Hi all,
> >> >
> >> > I am t
On Monday, October 31, 2016 at 6:30:12 PM UTC+1, Irmen de Jong wrote:
> On 31-10-2016 18:20, Heli wrote:
> > Hi all,
> >
> > I am trying to read an ascii file written in Fortran90 using python. I am
> > reading this file by opening the input
Hi all,
I am trying to read an ascii file written in Fortran90 using python. I am
reading this file by opening the input file and then reading using:
inputfile.readline()
On each line of the ascii file I have a few numbers like this:
line 1: 1
line 2: 1000.834739 2000.38473 3000.349798
line
Thanks for your replies. Let me explain my problem a little bit more. I have
the following data which i read from a file using numpy.loadtxt and then i sort
it using np.lexsort:
x=f[:,0] # XColumn
y=f[:,1] # YColumn
z=f[:,2] # ZColumn
val=f[:,3] # Val Column
xcoord=np.sort(np.unique(f[:,0])) # X
Hi,
I sort a file with 4 columns (x,y,z, somevalue) and I sort it using
numpy.lexsort.
ind=np.lexsort((val,z,y,x))
myval=val[ind]
myval is a 1d numpy array sorted by x,then y, then z and finally val.
how can I reshape correctly myval so that I get a 3d numpy array maintaining
the xyz orderi
Hi,
I have a 3d numpy array containing true/false values for each i,j,k. The size
of the array is a*b*c.
for each cell with indices i,j,k; I will need to check all its neighbours and
calculate the number of neighbour cells with true values.
A cell with index i,j,k has the following neighbou
Dear all,
After a few tests, I think I will need to correct a bit my question. I will
give an example here.
I have file 1 with 250 lines:
X1,Y1,Z1
X2,Y2,Z2
Then I have file 2 with 3M lines:
X1,Y1,Z1,value11,value12, value13,
X2,Y2,Z2,value21,value22, value23,...
I will need to
Hi,
I need to read a file in to a 2d numpy array containing many number of lines.
I was wondering what is the fastest way to do this?
Is even reading the file in to numpy array the best method or there are better
approaches?
Thanks for your suggestions,
--
https://mail.python.org/mailman/li
Thanks Michael,
This did the trick. array.flatten('F') works exactly as I need.
Thanks a lot,
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
I have a question regarding reshaping numpy array.
I either have a 1D array that I need to reshape to a 3D array or a 3D array to
reshape to a 1d numpy array.
In both of these cases it is assumed that data follows x,y,z ordering.
and I use the following to reshape the numpy array.
Yes, the python I have installed is 64bit.
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit
(AMD64)] on win32
and the scipy wheel I am trying to install from is :
scipy-0.17.0-cp34-none-win_amd64.whl
At Sayth: Thanks for recommending Anaconda. I already am familiar
Hi all,
I have a python34 installed on a windows-64bit machine. I am using Eclipse
pydev editor. I need to used griddata from scipy.interpolate.
I have installed scipy using by downloading the followng wheel file:
scipy-0.17.0-cp34-none-win_amd64
and isntalling using pip install. The install
As you said, this did the trick.
sortedVal=np.array(val[ind]).reshape((xcoord.size,ycoord.size,zcoord.size))
Only val[ind] instead of val[ind,:] as val is 1D.
Thanks Oscar,
--
https://mail.python.org/mailman/listinfo/python-list
Thanks Oscar,
In my case this did the trick.
sortedVal=np.array(val[ind]).reshape((xcoord.size,ycoord.size,zcoord.size))
--
https://mail.python.org/mailman/listinfo/python-list
Thanks a lot Oscar,
The lexsort you suggested was the way to go.
import h5py
import numpy as np
f=np.loadtxt(inputFile,delimiter=None)
xcoord=np.sort(np.unique(f[:,0]))
ycoord=np.sort(np.unique(f[:,1]))
zcoord=np.sort(np.unique(f[:,2]))
x=f[:,0]
y=f[:,1]
z=f[:,2]
val=f[:,3]
ind = np.lexsort(
Thanks for your replies. I have a question in regard with my previous question.
I have a file that contains x,y,z and a value for that coordinate on each line.
Here I am giving an example of the file using a numpy array called f.
f=np.array([[1,1,1,1],
[1,1,2,2],
[1,1,3
On Wednesday, March 23, 2016 at 11:07:27 AM UTC+1, Heli wrote:
> Hi,
>
> I have a 2D numpy array like this:
>
> [[1,2,3,4],
> [1,2,3,4],
> [1,2,3,4]
> [1,2,3,4]]
>
> Is there any fast way to convert this array to
>
> [[1,1,1,1],
> [2,2,2,2]
>
Hi,
I have a 2D numpy array like this:
[[1,2,3,4],
[1,2,3,4],
[1,2,3,4]
[1,2,3,4]]
Is there any fast way to convert this array to
[[1,1,1,1],
[2,2,2,2]
[3,3,3,3]
[4,4,4,4]]
In general I would need to retrieve every nth element of the interior arrays in
to single arrays. I know I can
On Thursday, March 10, 2016 at 5:49:07 PM UTC+1, Heli wrote:
> On Thursday, March 10, 2016 at 2:02:57 PM UTC+1, Peter Otten wrote:
> > Heli wrote:
> >
> > > Dear all,
> > >
> > > I need to loop over a numpy array and then do the following search. The
>
On Thursday, March 10, 2016 at 2:02:57 PM UTC+1, Peter Otten wrote:
> Heli wrote:
>
> > Dear all,
> >
> > I need to loop over a numpy array and then do the following search. The
> > following is taking almost 60(s) for an array (npArray1 and npArray2 in
> >
Dear all,
I need to loop over a numpy array and then do the following search. The
following is taking almost 60(s) for an array (npArray1 and npArray2 in the
example below) with around 300K values.
for id in np.nditer(npArray1):
newId=(np.where(npArray2==id))[0][0]
elements with shape 10*2*10 appears. If it does, then I want the indices of the
bigger dataset where this happens.
I hope I´m making myself more clear :)
Thanks for your comments,
On Wednesday, December 9, 2015 at 5:37:07 PM UTC+1, Peter Otten wrote:
> Heli wrote:
>
> [Please don
Dear all,
I need to check whether two 2d numpy arrays have intersections and if so I will
need to have the cell indices of the intersection.
By intersection, I exactly mean the intersection definition used in set theory.
I will give an example of what I need to do:
a=[[0,1,2],[3,4,5],[6,7,8]]
Dear all,
I am reading a dataset from a HDF5 file using h5py. my datasets are 3D.
Then I will need to check if another 3d numpy array is a subset of this 3D
array i am reading from the file.
In general, is there any way to check if two 3d numpy arrays have intersections
and if so, get the in
Thanks Christian,
It turned out that h5py.defs was not the only hidden import that I needed to
add.
I managed to get it working with the follwoing command adding 4 hidden imports.
pyinstaller --hidden-import=h5py.defs --hidden-import=h5py.utils
--hidden-import=h5py.h5ac --hidden-import=h5
Dear all,
Thanks a lot for your replies. Very helpful. I have already done some trials
with Virtualenv, but PyInstaller is much closer to the idea of an installer you
can pass to someone.
I have been using development version of PyInstaller in order to be able to
use it with my script writt
Dear all,
I have my python scripts that use several python libraries such as h5py,
pyside, numpy
In Windows I have an installer that will install python locally on user machine
and so my program gets access to this local python and runs successfully.
How can I do this in Linux ? ( I wan
On Thursday, July 23, 2015 at 1:43:00 PM UTC+2, Jeremy Sanders wrote:
> Heli Nix wrote:
>
> > Is there any way that I can optimize this if statement.
>
> Array processing is much faster in numpy. Maybe this is close to what you
> want
>
> import numpy as N
> # i
Dear all,
I have the following piece of code. I am reading a numpy dataset from an hdf5
file and I am changing values to a new value if they equal 1.
There is 90 percent chance that (if id not in myList:) is true and in 10
percent of time is false.
with h5py.File(inputFile, 'r') as f1:
38 matches
Mail list logo