67 Discussion / Question Topics
Remove Filter Hey guys, Has anyone here ever used python to produce data files which can be immediately read by excel? I thought at first if I just tab-delimited my data, I could copy and paste an entire data file into excel. This is not the case. When I take a tab … | |
Hey guys, When using the glob import, I want it to scan all of the files in a directory, but not scan other directories in that directory. For example, say I am in a directory with the following files: [CODE]file, file1, file2, DIRECTORY1, DIRECTORY2[/CODE] When I use the glob command: … | |
Hey guys, A while ago, with your help, I was able to create a code which scans a data file for names, and when a new name is found, it appends it to a list. For each entry is the list, the code then opens a new file for each … | |
Hey guys, I have been trying to search for this answer on online tutorials, but cannot figure out just what I am doing wrong. I have a list of names, and some of them have the character '/' For example: [CODE]list = [adam, bill, jon/juan][/CODE] Because later in my code, … | |
Hey everyone, I tried a site search but it turned up cold. Has anyone here ever written a small method to take a list of names and sort them in alphabetical order? If so, would you mind posting it up, or directing me to a tutorial that would explain this … | |
Hey guys, I wrote a file the other day, which reads in data, adds a column, and then reads the data out to a specific file. I thought everything was working great, with all of your help; however, I am now running into another problem. The output data looks like … | |
Hey everyone, I am writing a simple code, and seek to do something which I don't know whether it is possible or not. First, I have a name list: [CODE]Name_List = ["Jake", "Steve", "Adam"];[/CODE] The first thing I'd like to do is open a separate file for each name in … | |
Hey everyone, Here is an outline of my problem: I have a working code which defines a class, GeneDict, which reads in data from a special type of file, and stores it as a dictionary. What it is really doing is taking in millions of lines of biological data, and … | |
Hey everyone, I wrote a code which runs a game of rock paper scissors, and each time you lose, it counts down until at 0, it exits. The only way I've been able to exit the code is to throw in a 'sys.exit()' command. I hear there are better ways … | |
Hey all, I have a class with various methods and I want to pass the output of one method into the next method. For example: [CODE]class RockPaperScissors: '''Rock paper scissors game, best of 3''' tries = 3 def __init__(self, name): 'Reads in users call' self.name = name print 'You picked … | |
I am trying to learn object oriented programming and am still shaky on the ins and outs of classes. I understand their purpose, but can't seem to grasp many simple operations when using them. The dive into python section on classes is not very helpful either, so if you know … | |
Hey guys, Have been working on this tiny simple code for an hour and can't figure out how to fix it. The code does this: Reads in 3-column, tab-delimited data file Adds "1000" in the fourth column to every line Writes out the 4-column file [ICODE]def columns(infile, outfile): f = … | |
Hey everyone, I have the following data set A B C D E F G H I J K L M N O P Q R S T Where every ten lines or so (though not a regular pattern) the data breaks its format and two of the data pieces … | |
First let me say thanks to everyone who has been responding to my posts and providing valuable insight. I have been trying to add rep whenever possible, and appreciate your help. My assignment was to write a python code which takes data from an infile, then has the user specify … | |
Hey all, I ran a code today which digested an input file which was 304 MB, consisting of about 10 million lines with six columns a piece. I ran the code and got an indexing error. In troubleshooting, I copied only the first 1,000,000 lines into a new data file, … | |
Hey fellas, I have searched for this answer for about an hour on and off and cannot find anything so sorry to have to resort to posting. I have a list [a, b, c, d] And I want to write it to a simple output file, but I want it … | |
Hey guys, I'm new to python so if this is a silly question, pardon me. I have the following basic assignment: Take a user-specified range of lines from some data file, call it input, and write them to an output data file. What I want to do is have the … |
The End.