Colin Ross | 29 Jun 19:05 2016

Reading in large .dat file

Good afternoon,

I have a .dat file that is 214 rows by 65 columns that I would like to read
into python and plot the 1st column versus all other columns.

My code:


import numpy as np
import scipy
import pylab as pl
import matplotlib
from matplotlib.ticker import ScalarFormatter, FormatStrFormatter
import sys

# Load in text from .dat file

sed = np.loadtxt('spectra.dat', unpack = True)

# Access column data

col1 = sed[0]
col2 = sed[1]
col3 = sed[2]
col4 = sed[3]
col5 = sed[4]

wavelength = col1
flux_1 = col2
(Continue reading)

Aaron Johnson | 28 Jun 07:54 2016


I have a program that is telling my i need your digital snake, but i dont
want a snake. Help
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

boB Stepp | 28 Jun 04:52 2016

OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

My eyes are glazing over from hours and hours of Googling on this.  I
cannot come to a rational conclusion.  Perhaps someone can help me to
do so.  I currently have a 64-bit desktop PC that I built myself.  It
is running Win7 Pro 64-bit.  I need to keep this OS as I need to run
various chess software which can be quite CPU and RAM hogging.  So an
emulation layer like Wine would not be desirable.  I don't want to run
Linux in a virtual environment; I'd rather have a dual-boot setup.  My
intent is to transition to mostly using Linux as my main OS and only
going back to Win7 when I must use certain software applications.
Also, this would be a fine time to stop Easter-egging around the
shell, etc., and more systematically learn *nix-stuff.  And quite
frankly I am getting quite tired of PowerShell and cmd.exe;  at least
compared to my Solaris 10 experiences.  So:

1)  I am not ready at this time to take on the challenge of *really*
getting into understanding *nix by installing something like Arch
Linux and having to configure almost *everything* myself from scratch.
However, I do like Arch's install once and enjoy very frequent OS and
package updates, huge package repository, etc.

2)  (1) led me into looking at Manjaro Linux.  This looks very
attractive, but there have been enough tales of woe to multi-boot
installations, that it gives me a bit of pause.  Otherwise, I think I
would immediately go this route.

3)  I do not care about eye candy.  If you could see my current
Windows desktop, it is just a solid plain blue.  In fact, a
light-weight desktop environment would be preferable as long as it was
quite functional.  Currently XFCE looks attractive.  I first ran into
this while looking at (2), but it is popping up quite frequently in
(Continue reading)

marcus lütolf | 26 Jun 17:35 2016

installing openpyxl

dear Experts,

first question :
could someone please tell me what exactly I have to type in my a) Python 35
– command line or 

b) desktopcomputer ( W10, 64bit)-command line in ordert to install openpyxl
which I downloaded in

C:\Users\marcus\Downloads on my computer. 
I have used all kinds of commands with ‚pip install‘ at the end, all

Second question:
(this might not be a topic for this forum but an answer would be most
I try to write code for parsing the internet using a raspberry Pi B+ via
remote access 

with puTTY from my desktop computer.
I am unable to find the appropriate password,  ‘raspberry’ is denied.

Thanks for help.


Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
(Continue reading)

Severin Langberg | 26 Jun 14:16 2016

Coding help 1D diffusion equation


I have a problem with solving the 1D diffusion equation for Gaussian
initial using odeint. Anyone care to help?

Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Ek Esawi | 25 Jun 09:04 2016

Most efficient way to read large csv files with properly converted mixed data types.

Hi All--

My work involves reading large csv files with mixed data types (integer,
float, string, time and date). I was able to accomplish the task using (1)
genfromtxt or (2) looping through each line in the file and split, strip,
and assign data type to each entry.

I am wondering if there is a better and more efficient alternative,
especially to method 2 without using numpy or pandas. Alan Gauld mentioned
namedtuples for another question. I read a little about collections and in
particular namedtuples but was not sure how to apply theme here, if they
are applicable to begin with.

Thanks in advance--EKE

An example of a file:

A         B         C         D                     E

1          2.3       ‘aa’      10/01/2016      12:30

4          25.6     ‘bb’      02/02/2015      1:30
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:
Alex Hall | 24 Jun 15:07 2016

For-else... Any other handy constructs hiding in Python?

Hey all,
I was looking at how to make my different jobs retry themselves, and found
the for-else construct. I know loops, comprehensions, ifs, and the like,
but I never knew for-else was available. Are there other constructs that I
may have missed--shortcuts or seemingly odd pairings of control statements
like this? Python has a lot of really cool shortcuts and features, like
get/hasattr, the yield keyword, or comprehensions. I always like finding
more to add to the toolbox.


Alex Hall
Automatic Distributors, IT department
ahall <at>
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Hershel Millman | 24 Jun 02:21 2016

turtle on linux

This is from my terminal on Fedora 24:

[hmillman <at> localhost ~]$ python
Python 2.7.10 (default, Sep 24 2015, 17:50:09)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named turtle

How do I solve this problem?

Thank you,

Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Lennartson, Elizabeth M | 23 Jun 16:02 2016

Opening EOS-5 HDF file - help!

I am trying to open a HDF file in python. I downloaded python 2.7.8 through miniconda2. I also downloaded
basemap-1.0.7, matplotlib-1.5.0, and numpy-1.11.0. I am trying to do this example: I can execute "import os" but when I try to execute "import
matplotlib as mpl," I get the following error:

File "<stdin>", line 1, in <module>

ImportError: No module named matplotlib

I am new to programming, so I am not sure what the issue is. Thanks for your help!
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Bharath Swaminathan | 23 Jun 20:00 2016


Can I run my python code in multiple processors? I have a dual core...
Tutor maillist  -  Tutor <at>
To unsubscribe or change subscription options:

Alex Hall | 23 Jun 23:08 2016

Best way to use excepthook here?

Hey all,
How would I go about sharing a reassignment of excepthook, where that
assignment is made to a central function and could come from any of several

I'm replacing a bunch of SQL jobs at work, and my boss said he doesn't care
which language I use. Naturally, Python it is. :)

All these jobs do different things, and run at different times and
different intervals. Some update files on our FTP server, some email the
previous day's shipping errors, some back up databases, and so on. The
setup I'm going to try first is one file per job, with and a
couple others shared between them all. That way, any job that needs to
email can just
import emailer
and every job can access configuration data:
import utils

One thing that provides is logging:

import utils
logger = utils.ADLogger("Job Name")

The ADLogger object sets the level, the file name, the formatter, and so
on. It also has a function: logException(self, type, value, traceback).
This simply logs the exception, since ADLogger is a subclass of

Finally, my question. Say job1 and job2 run within a minute of each other,
(Continue reading)