Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
8 votes
5 answers
837 views

adding data to a CSV file for it to be read

I'm making a program that lets you enter a name and house that adds it to the CSV file for it to be read and print out "Tre is in house Dragon", etc. The code works; I'm just wondering if ...
Big_Port's user avatar
  • 121
3 votes
2 answers
233 views

Saving Scraped Data to a File

When scraping and saving data into a file, Which method is more efficient when saving scraped data to a file? open the file first, scrape, and save the data all ...
Seraph776's user avatar
  • 201
3 votes
2 answers
992 views

Transform dict of lists to CSV

I want to transform this dict to CSV: ...
Rohan Kishibe's user avatar
4 votes
2 answers
356 views

Read a file format with mixed CSV and non-CSV content

I have a file format that I need to read which contains blocks of CSV data interspersed by non-CSV (or at least, inconsistent CSV) lines. Other than the very first line of the file (which has comma-...
Ajean's user avatar
  • 263
0 votes
1 answer
344 views

Sorting nested dictionary by price - without extra memory

I am working on parsing an orders.csv file with products and prices by different vendors which is kind of a time-series data. The output of that process looks something like below, with order total by ...
Prashanth kumar's user avatar
3 votes
2 answers
1k views

Create csv file for each id value and write all data rows to csv with same id

I have a text file which is tab delimited: 1 324 2344 1 8372 1234 2 62 12 2 872 12111 2 1211 28736 3 87636 198272 The first &...
jim's user avatar
  • 33
1 vote
2 answers
1k views

Create an ASCII table from CSV

The following code convert csv to ascii table. ...
Ahmad Ismail's user avatar
1 vote
1 answer
352 views

How to speed up the search by patterns matching and modifying a DataFrame

I need to classify URLs from a DataFrame and modify it by exact match and contains conditions: ...
drkwng's user avatar
  • 25
3 votes
1 answer
1k views

Mapping CSV columns

I have the following code where I am trying to map columns from the input file to output. I have written it using multiple loops. Is there a way to write this more efficiently? input.csv: ...
pythonicwiz's user avatar
3 votes
1 answer
82 views

Open and update CSV file

...
jp0514's user avatar
  • 31
1 vote
1 answer
2k views

Processing CSV files with filtering

I have 4 CSV files that i need to process (filter out Part segment and then merge them) but the problem is that they do not fit in my memory. So I decided to: [open - filter - write out] each one of ...
amous's user avatar
  • 13
2 votes
2 answers
6k views

Python script to extract columns from a CSV file

I have a very basic python script that reads a CSV file. I'm importing the csv module setting some empty list variables and getting the data I want. The problem is that I know there is a much more ...
user avatar
7 votes
2 answers
326 views

Concatenate several CSV files in a single dataframe

I have currently 600 CSV files (and this number will grow) of 50K lines each i would like to put in one single dataframe. I did this, it works well and it takes 3 minutes : ...
TmSmth's user avatar
  • 259
3 votes
1 answer
100 views

Sending a CSV file for a client list from a database

What can I improve about this code in order to be production-ready? I'm not worried about security but about errors that could occur. What exceptions should I catch? I feel overwhelmed about ...
escarta's user avatar
  • 43
3 votes
1 answer
103 views

Calculating the total daily amount of confirmed cases of Coronavirus

I'm writing a small program to plot new COVID-19 infections. As of right now, I have it so the program reads the given data file, pulls out the daily cases and dates for each country, and adds ...
0f-bajor's user avatar

15 30 50 per page
1
2 3 4 5 6