English 中文(简体)
How to use python, PyLab, NumPy, etc for my Physics lab class over excel
原标题:

I took a scientific programming course this semester that I really enjoyed and experimented with a lot. We used python, and all the related modules. I am taking a physics lab next semester and I just wanted to hear from some of you how python can help me in ways that excel can t or in ways that are better than excel s capabilities. I use Mathematica for symbolic stuff so I would use python for data purposes.

Off the top of my head, here are the related things I can do:

  • All of the things you would expect in a intro course (loops, arrays, slicing arrays, etc).

  • Reading data from a text file.

  • Plotting scatter, line, and bar graphs.

  • Learning how to plot linear regression but haven t totally figured it out.

  • I have done 7 of the problems on Project Euler (nothing to brag about, but it might give you a better idea of where I stand in skills).

Looking forward to hearing from some of you. You don t have to explain how to use the things you mention, I could look up the documentation.

问题回答

The paper Python all a scientist needs comes to mind. I hope you can make the needed transformations from Biology to Physics.

Scipy will also be useful to you, as it includes many more advanced analysis tools. For example, Scipy includes a linear regression, and gets more interesting from there. Along with the other tools you mentioned, you ll probably find most of your needs covered.

Other notes on tool selection:

  1. Mathematica is a great tool, if you can afford it. I ve played around with the other options, like Sympy, and sadly, they don t come close to being as useful as Mathematica.
  2. I can t imagine using Excel for any serious scientific work. If you re planning to continue forward using the tools that you learn in class, you might as well start with tools that offer you that potential.

Don t reject Excel outright. It s still great for doing simple data analysis and plotting. Excel also has the considerable advantage of being installed on most engineer and scientist s computers, making it a lot easier to share your work with colleagues.

That said, I do use Python when Excel just won t cut it; times when I ve had to:

  • color the points in a scatter plot based on a third column
  • plot a field of vectors
  • extract a few values from each of several thousand data files to do statistical process control
  • generate dozens of scatter plots over different dimensions of a large data set to find which variables are important
  • solve a nonlinear equation at several intermediate points of a calculation, not just as the final result.
  • accept variable length input from a user to define a problem

VBA in Excel can do a lot of those things too, but it becomes painful fast in such a primitive language. I dream that Microsoft will make IronPython a first-class scripting language in the next version of Excel. Until then, you might want to try Resolver One

I can recall 2 presentations by Jan Martinek on EuroScipy 2008, he s PhD candidate and presented some fun experiments with Physics in the background. Abstracts are here and I m sure he would t mind to share more if you contact him directly. Also, take a look at other presentation from EuroScipy, there are some more Physics-related ones.





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签