A comma-separated values (CSV) file stores tabular data (numbers and text) as plain text, with rows and columns delimited by line terminators and commas, respectively. You may also use this tag for variants where fields are separated by tabs or semicolons.
0
votes
2answers
28 views
3
votes
1answer
57 views
Arithmetic quiz with class database and score analysis
I have done this quiz project and I have tried as hard as I could when I was writing to make it user friendly to read. Could you help me on improving and making it more user friendly please.
...
0
votes
1answer
28 views
csv loader and kNN algorithm in Java
I have applied the KNN algorithm for classifying handwritten digits. the digits are in vector format initially 8*8, and stretched to form a vector 1*64..
As it stands my code applies the kNN ...
1
vote
1answer
42 views
Reading a CSV file containing a dataset of 8×8 images
I am trying to implement a machine learning algorithm (k-nn for example). But before I attempt to do that I was hoping for some feedback on my current Main class, which essentially builds 8×8-pixel ...
0
votes
1answer
31 views
Find csv item index
I'm quite new to Python and I have been trying to find a way to search a csv for a test string and return the index of that item in the csv.
I am using the code below but find it hard to believe that ...
3
votes
1answer
100 views
Joining huge CSV files and splitting the result into batches
I've got ~20GB of data about the same subject, concatenated from small files of 16kB, each produced by different measurement equipment. They share some headers (on the example: B, D & E) and they ...
3
votes
0answers
44 views
Python Script to query OSRM (drive-times)
The below script takes two arguments
Path to the OSRM Map
Path to a .csv containing the columns ...
25
votes
5answers
3k views
Performance of a Foreach inside a Foreach iterating through a million records
I have two DataTables:
dt: is populated from a CSV file with over 1.7 million rows
dataStructure.Tables["AccountData"]: is ...
3
votes
1answer
55 views
Reducing memory footprint when manipulating big csv file
I have CSV file which has structure like this (separated by tabulators):
...
7
votes
1answer
64 views
RFC 4180-compliant CSV parser in Java
While looking at a recent question, I realized that there is no CSV parser in the standard Java library. I decided to write one that complies with RFC 4180. Highlights of the standard include:
...
2
votes
1answer
52 views
Student data parsing application
My application takes a .csv (comma separated values) file and serializes the data into a binary file. Then it converts the binary file back to a .csv file (identical to the original file).
For ...
2
votes
2answers
56 views
4
votes
3answers
43 views
csview: A tiny utility to view csv files
Seeing a csv in table form is nicer then viewing it as row text, for example the csv from Calculate food company sales for the year (with headers added by me) looks much nicer in this table form than ...
7
votes
2answers
78 views
Calculate food company sales for the year
I am working on a Python project where a food processing company is trying to calculate its total sales for the year. Python has to read from a text file where its divided into for categories split by ...
6
votes
3answers
223 views
Loading tab-separated tweet data into an array
I'm working on this school project and was wondering if there was any way of storing this information better, faster, more professionally. I'm also restricted to only using an array; don't ask me we ...
1
vote
2answers
134 views
Maths quiz that read/writes CSV files [closed]
Could this code possibly be shortened, or even better be rewritten in the fewest lines of code possible?
...
4
votes
3answers
118 views
Write data from database to a CSV file
I have a database containing a high amount of data. I want my app to filter and select only some of it, and save it into a CSV file or JSON.
For the moment I have this method which takes the data ...
2
votes
1answer
60 views
A Dynamic CSV Serializer
I made a dynamic CSV serializer as a learning challenge a while back, I'm hoping to get my code picked apart so I can learn what I can do better.
This is a bit long, so I wouldn't expect anyone to ...
1
vote
2answers
52 views
Replacing data in a .csv file
The code works well and does what I intend for it to do. In essence, it opens a file referenced as 'resource'. This is a .csv file. I then searches for the keys in the dictionary and for each key that ...
3
votes
1answer
52 views
Creating a table within a .csv file
I recently made a post on Code Review entitled Writing lists to .csv file. I found the feedback extremely helpful, and wished to provide a continuation of that particular topic; of working with Python ...
1
vote
1answer
32 views
Writing a Counter object to a CSV-file in Python 3
In Python 3.4, a Counter object called cnt like this:
...
3
votes
2answers
53 views
Compare lines in 2 text files with different numbers of fields
This is the (hopefully) final version of my script for my file comparison problem mentioned previously in two posts on Stack Overflow (here and here).
I have come up with the code shown below, which ...
1
vote
0answers
135 views
Opening the same CSV file in two different ways in order to transform data in one column and update original CSV using Python
I have the following functions and accompanying script. The purpose of these is is to extract XML data from one CSV column (one XML document for each row), and then transform it into a dictionary ...
5
votes
1answer
87 views
Query AD and build CSV based on certain user object properties
My question is about code efficiency. I recently had to write a Powershell 3.0 script which had the following criteria:
It had to pull all enabled user objects from active directory
It had to pull ...
7
votes
3answers
52 views
Accessing files in a child directory in Python 2.7.x
I have written the below script for use in Python 2.7.x. In essence, I want the script to access a folder contained within the directory the script is and then add all files contained within to a ...
7
votes
1answer
113 views
Writing lists to .csv file
I'm teaching myself programming, using Python as my initial weapon of choice.
I have learnt a few basics and decided to set myself the challenge of asking the user for a list of names, adding the ...
6
votes
1answer
39 views
Convert data back-and-forth between CSV files and pretty-print
I wrote a script to convert CSV files in human readable format and vice versa.
Human readable format is achieved like so:
...
8
votes
2answers
56 views
Iterate list to map entries in Python
I have two files, namely:
File1:
CL1 AA XX YY ZZ SS \n
CL2 3_b AA
File2:
AA string1
AA string2
3_b string3
My ...
12
votes
3answers
584 views
Retrieving a csv header
I have two seperate calls that returns a .csv file. I need to extract a couple of headers from the files depending on which one is called. The headers does not always sit in the same index, and the ...
7
votes
3answers
146 views
MP3 Vote Collator - Final
Here is the completed code for my first Python project, for which I received some help and feedback here: Collate votes on MP3 files to list them by popularity
Seeing as there have been considerable ...
8
votes
3answers
165 views
Collate votes on MP3 files to list them by popularity
For my first Python project, I decided to create a script that would automatically collate MP3 files into a music countdown. I wanted to 'learn by doing', so I dived straight in and used the Python ...
6
votes
3answers
51 views
Categorizing gene sequences read from a CSV file
I am relatively new to programming and would love to get some feedback on the following section of my code.
...
4
votes
1answer
41 views
Powershell to break apart large flat files (e.g. csv)
I created the below script to help break apart large flat files; to save myself effort opening files which are several gigs in a text editor and manually split them.
So far I've only tested on sample ...
7
votes
4answers
219 views
Blocking production lines in Python
I have the following code that works great, but takes 40 mins to 1 hours to finish the task. It has at least 30 rules for blocking lines, and 30k+ orders to check. I'm new to Python (3 months working ...
3
votes
2answers
142 views
Python code to encrypt and email PDF file using PyPDF2
This is my first programming project with real world application. It's purpose is to take a file from a directory, encrypt it with a predetermined password, and email to appropriate recipient.
ID ...
3
votes
1answer
96 views
Finding nearest float values corresponding to a data point (of three variables) in a table with multiple columns using C++
I have a data file which contains floating point data arranged in 4 columns. Each row represent a specific data point. The first column(X) is made up of 100 different values but the values are ...
1
vote
1answer
34 views
Computing sums in some CSV files horizontally and in other CSV files vertically
I'd like to eliminate the code duplication in the following two methods by moving the common code into a separate method callable by both. The comments indicate the blocks of code that have a ...
3
votes
3answers
422 views
Merging two files into one .CSV
I'm relatively new to Python scripting. I made a script that takes two raw data files and merges them into one CSV file, but it takes a long time to complete. Are there any logic problems in this ...
0
votes
1answer
33 views
Parsing an uploaded file, returning record of 10 fields for each line [closed]
I have a program that reads a .txt file from a given directory. Each record line contains a data and I am parsing it. I think this is costly with it comes to performance but I might be wrong. Here is ...
3
votes
0answers
41 views
Change an identifier in a .csv file, based on another .csv file
I have only dabbled in Java before (my previous experience being mostly with PHP and JavaScript) but a request come through for a small application that seemed like a good chance to get some ...
2
votes
0answers
69 views
Clean reading of HTML table with R
I have some data under an HTML format and would like to import it in R. However, it seems that type inference is much less sophisticated than what exists with functions such as read.table. I am using ...
3
votes
2answers
41 views
Writing embedded list to CSV in Python
I have a method in a Python app to write a list of records to a CSV file. Each record is a "football player", which is really just a dictionary. But one of the dictionary items contains a list of ...
1
vote
2answers
316 views
Parsing a CSV file in node.js and express.js
I want to import a CSV file and do some operation on it.
The following is the code I'm using and it is working fine:
...
3
votes
5answers
293 views
Loading and converting data from CSV
My application imports a CSV file and parses each row, turning it into an object in my code.
The speed for a 500,000 row x 68 column takes 2+ minutes to read. I've narrowed down the bottleneck to the ...
2
votes
2answers
93 views
Creating a tuple from a CSV file
I have written code that reads in a CSV file and creates a tuple from all the items in a group. The group ID is in column 1 of the table and the item name is in column 2. The actual datafile is ~500M ...
1
vote
0answers
43 views
Copying csv to sql_table
I wrote code that takes csv and export it to sql table. It looks like this:
...
2
votes
1answer
40 views
Determine column averages
I'm trying to write terse Perl code to calculate the average of each column in a file. The file can have >= 1 columns.
...
4
votes
2answers
141 views
Grouping positive & negative reviews and counting the words
Can somebody help me make the code below smarter and free of redundancy? The code does exactly what I want, but I believe there are many redundant loops and arrays.
...
3
votes
4answers
96 views
Using Python to rename multiple csv files in Windows
I need to rename a large list of csv files that are generated from 3 different servers. The files are produced with a date stamp as the extension, which I need to move in each file name to retain the ...
2
votes
2answers
68 views
Processing eBay category list for database import
Although I've been programming a fair while I'm learning Python and would like to know how I can make my code more "Pythonic".
I'm have a CSV file of eBay categories, containing the name and numeric ...