Cython is a compiler which compiles Python-like code files to C code. The resulting functions can then be imported into other Python scripts. This method can be used to increase the execution speed of a Python script, particularly if the script uses for-loops. I have added a Cython page to: Vibrationdata Python Wiki The page [...]
Archive for the ‘Python’ Category
Cython
Posted in Python on November 10, 2011 | Leave a Comment »
Generalized Eigenvalue Problem
Posted in BLAS, C/C++ Compilers, Eigenvalues, Fortran, GNU GCC, LAPACK, PETSc, Python, SLEPc, Structural Dynamics, Ubuntu on November 1, 2011 | 1 Comment »
The goal of this project is to solve a “very large” generalized eigenvalue problem in a “reasonable” amount of time using library functions. The mass and stiffness matrices may be either dense or sparse. Optimum routines are desired for each case. Here is description of the libraries and packages gcc – GNU Compiler Collection for [...]
Python Wiki
Posted in Python on July 7, 2011 | Leave a Comment »
With the encouragement of my NASA colleagues, I have started a Python Wiki at: http://vibrationdata.com/python-wiki/index.php?title=Main_Page Please visit this site and contribute your own experience. Thank you, Tom Irvine
Python: reading two columns of numerical data with an arbitrary number of header & blank lines
Posted in Python on July 2, 2011 | Leave a Comment »
Here is my current method. Please let me know if you have a better one. The input data may be either space, tab, or comma delimited. ########################################################################## import os import re from numpy import array,zeros,concatenate,linspace,std from sys import stdin import matplotlib.pyplot as plt ######################################################################## def start(): print(” “) print(“Entpath =stdin.readline() file_path = input_file_path.rstrip(‘\n’) if os.path.exists(file_path): [...]
Python on Linux
Posted in Python on June 29, 2011 | Leave a Comment »
I have installed Linux Ubuntu on my 64-bit Windows PC, turning it into a dual boot configuration. The link is: http://www.ubuntu.com/download/ubuntu/windows-installer * * * I have also installed the Linux versions of Python & Spyder. Here is a Python installation method from Nick Smith: Part of the beauty of switching to Python is how cross-platform [...]
Python Tip
Posted in Python on June 23, 2011 | Leave a Comment »
Every Python book and website tutorial recommends the following command for prompting the user for input: raw_input() But I have found that this command is buggy and unreliable. Specifically, I wrote a long, complex code that had several raw_input() commands. The code ran successfully in Spyder. But I received the following error when I ran [...]
Python Progress
Posted in Python on June 15, 2011 | Leave a Comment »
The Python scripting program, ver 2.7.2, can be freely downloaded from: http://www.python.org/download/ Programmers will also need to install libraries such as NumPy, SciPy and matplotlib, particularly for science and engineering programming. These libraries are also freely available, but their proper installation and integration with Python is tricky. As an alternative, a package of Python with these libraries and [...]
Python
Posted in Python on June 10, 2011 | Leave a Comment »
I had the opportunity today to speak with several engineers from the Aerospace Corporation. They said that their organization is beginning a gradual transition from Matlab to Python. Python is an interpreted, interactive, object-oriented, open-source programming language. In addition, numerical library functions are available for Python. So I am now learning Python. I will write a set [...]