All Questions
33,471
questions
-1
votes
0
answers
21
views
How to use CSV in function [closed]
I wrote this code but I do not know how to add my CSV files to it
import hashlib
import csv
from collections import OrderedDict
hp = OrderedDict()
akahr = OrderedDict()
def hash_password_hack(...
-1
votes
0
answers
44
views
How to split a info in a single row in excel into columns using python [duplicate]
I have read a CSV file using pd.read_csv()
I am trying to clean up this data but it is proving a bit difficult.
Essentially all of the information is in a single column and row 1 and I need to split ...
1
vote
1
answer
23
views
Read CSV with epoch timestamp column as timestamp
I'm using pyarrow.csv to read and convert a CSV file to parquet. This CSV file has a timestamp column with an int representing Unix time.
Nevertheless, it reads it as an int64, and if I try to use ...
-4
votes
0
answers
23
views
What are 0-3 effective general debugging practices to id the points and specific line #s of possible errors? [closed]
Context:
Currently my only normal strategy is adding print() statements at the end of methods, usually multiple at different checkpoints of a given python program.
The logic behind this is that if ...
0
votes
1
answer
55
views
How to update a BigQuery table with data from a local csv file while using Python?
Every day, I migrate data from a MySQL database to BigQuery. For most processes, I use LoadJobConfig().writedisposition with WRITE_APPEND. However, for my raw_stock table, using WRITE_APPEND doesn't ...
0
votes
1
answer
45
views
Generalizing the case of converting a .json file to .csv
I have .json files in the following format:
{
"uls":{
"equ1-L1-u": {"D": 1.10, "La": 1.50, "Lb": 1.50},
"equ1-L2-u": {&...
0
votes
1
answer
90
views
Is there a way to choose which cell/column of a CSV to upload a dataframe into, just like scraping data onto an excel file?
I have had experience with webscraping data onto excel files, and I know that when copying data down into an excel spreadsheet, you can choose which column to copy it into. (startcol = 10 as shown in ...
0
votes
2
answers
48
views
Ignoring text at the start of a CSV file
I'm trying to download a CSV file from the web. However, the first 20 lines are column definitions with the data starting at line 24 (the lines in between are blank).
The code I have is:
data = pd....
3
votes
1
answer
86
views
How to compare rows within the same csv file faster
I have a csv file containing 720,000 rows with and 10 columns, the columns that are relevant to the problem are ['timestamp_utc', 'looted_by__name', 'item_id', 'quantity']
This File is logs of items ...
-1
votes
0
answers
51
views
How do i search two files to know if the values are similar or not
I have two CSV files that I want to compare their contents and print the contents that doesn't have the same data. Most contents will have the same name but not all their data are accurate. I want to ...
-1
votes
0
answers
20
views
How to prevent csv.DictReader from setting values as strings when converting a csv into a list of dictionaries? [duplicate]
I'm making a list of dictionaries from a csv file, and want certain values in each dictionary (columns in the csv) to be set as integer/list/boolean instead of string.
My csv looks like
csv
My code is
...
1
vote
1
answer
31
views
Reading .csv column with decimal commas and trailing percentage signs as floats using Pandas
I am faced with reading a .csv file with some columns like this:
Data1 [-]; Data2 [%]
9,46;94,2%
9,45;94,1%
9,42;93,8%
I want to read Data1 [%] column as a pandas DataFrame with values [94.2, 93.4, ...
-4
votes
0
answers
70
views
How to split CSV data with newline, commas, quotes in the column of data? [closed]
I want to split the data line by line, but I am receiving newline and quotes in the data which is not allowing me that to split it by either newline.
CSV Data Received:
ISSUE ID,FACTOR NAME,ISSUE TYPE ...
-2
votes
0
answers
31
views
Create a csv file from a list of objects and each row correspond three objects [duplicate]
I got a file that looks like this
Name
address
number
James
Avn philips 2
555 555 55
Peter
Colton 34 postmen
444 444 44
Claudia
Rainssaw 345 sq three
333 333 33
How can I convert in a csv like this:
...
0
votes
2
answers
62
views
Python Pandas extract csv column containing json
I want to learn Pandas framework, so I find free csv with Euro data from kaggle.com
https://www.kaggle.com/datasets/piterfm/football-soccer-uefa-euro-1960-2024/data
But there're plenty of columns ...