My goal: Automate the operation of executing a query and output the results into a csv. I have been successful in obtaining the query results using Python (this is my first project ever in Python). I am trying to format these results as a csv but am completely lost. It’s basically just creating 2 massive rows with all the data
Tag: csv
I would like to take a data from in the csv file
this is the equivalent of my csv file; this csv file has 8000 data. I want to separate the “a”, “b”, ,”c”, … “z” in the customer column with the quantity column. this csv file is just an example, actually customers are too many. I don’t know the customer names. what i want is for each client to have their
Joining two CSV files with common column in Python without Pandas
I wanted to inquire on how I could merge 2 csv files so that I can generate queries. Note that I am not allowed to use the “pandas” library. As an example I have these 2 csv: data.csv: enti.csv: And what I’m looking for is to be able to join them through cod_enti and thus be able to evaluate the
Creating a large dataframe out of 100 csv files (full join required)
I need to create a dataframe one 100+ csv file. My issues is that I have more than 100 CSVs with more than 55000 rows in each (as primary keys). Now the difference between the csv files is that is all columns (maybe around 1200 columns) were broken into separate files. In other words, I need to do a FULL
Read, Split and Append csv to lists in python
Problem I need to build a backend function that will read the data within a csv file, split the values and append them to several lists. The program for adding/removing/displaying values form the lists is working but now I need to add file I/O. I have the file inventory.csv and have a function load_file_data() which is meant to read, split
Writing Dictionaries into a CSV
I am working on a web scraping project, I am trying to save the results into a CSV file, I want to save the key in the dictionary as columns and the values as a row, (keep in mind that the value pair in the dictionary refers to a variable that extracts data from a web site) Answer Here is
insert line break in python file after a fix number of elements to delimit columns in a csv file
I´ve been struggling a bit to find a way in python to force this file to create a jump to a new line after some number of elements (equal to the number of columns I will need to add which is 12) the CSV currently looks like this. the text of the first row looks like this . D276″,31386,10610,12122021 00:00:47840
Python – Trouble printing to CSV
My code seems to be outputting the list I want, however, when I try printing the list to CSV I do not get the same result on the .csv file for some reason. I am sure there’s something not right at the end of my code. Could anyone please shed some light? Thanks in advance. Answer I have not used
Python: values written to csv file are in reverse order?
Here is the code in question first: Here is an example output: Why is the csv being written in reverse? The time stamp should be going from 03:23:08 to 03:23:13, but it’s not.. I’m thinking it’s maybe because I’m calling this recursively? But not totally sure. the ‘a’ in the with open() is for ‘append’, so logically it should just
Problem with counting times a parameter is in a certain range
I am trying to count how many times a value, “i”, is in the range i<0.5. I am counting from a csv file. To be clear, I only want the number of times to be appended to a dictionary. I will post my code and the result I get. the result I want is like this:(86 is a place holder,