Category "csv"

What could be wrong with a Pandas DataFrame?

I couldn't make head or tail of this: I have a function that reads a bunch of csv files from a S3 bucket, concats them and returns the DataFrame: def create_df(

How to save JSON to CSV?

I am trying to use a raw data output from mixpanel API and save all events to a .csv. Mixpanel gives me the following data as <class 'str'>: {"event":"Te

Windows Powershell: How to compare two CSV files and output the rows that are just in either of the file but not in both

I have a file first.csv name,surname,height,city,county,state,zipCode John,Doe,120,jefferson,Riverside,NJ,8075 Jack,Yan,220,Phila,Riverside,PA,9119 Jill,Fan,120

convert a CSV file to JSON file

I am trying to convert CSV file to JSON file based on a column value. The csv file looks somewhat like this. ID Name Age CSE001 John

MariaDB losing data when importing CSV

I'm trying to import a CSV file into MariaDB. I've created the table with "varchar(300)" for each field, so it's not missing space. Also, when I loaded the file

Function failing to update spacing after comma

I have a csv file that has inconsistent spacing after the comma, like this: 534323, 93495443,34234234, 3523423423, 2342342,236555, 6564354344 I have written a f

How to split csv comma separated value as single row in a new column using pyspark

I have a log file in csv which has a column contains a list of filepaths separated by comma. I want to split those filepaths into new rows using pyspark(or exce

CSV adding values to an existing column and calling from a dictionary (no pandas)

I need to add some additional values to an existing column for my CSV file. So this is what I have so far: Sample input CSV file: Alfa,Beta,Charlie,Delta,Echo,F

Adding new key values in a dictionary that was imported from an CSV file?

Sorry But I can't use pandas. I have a sample input csv file that looks like this: Alfa,Beta,Charlie,Delta,Echo,Foxtrot,Golf,Hotel,India,Juliett,Kilo A1,B1,C1,D

Dynamically create CSV files for each section of a config.ini file

I am working on automating status reports using Python and the Jira API with a config.ini file. My goal is to have a config file where users can supply a jql st

how do i convert a .csv file to a .data file?

Does anyone know how to convert a .csv file to a .data or know how to use only half of a .data file like a csv file? I'm trying to achieve a mean Average Positi

Adding Leading Zeros in .csv file

I am trying to create a PowerShell script that adds two leading zeros to all the numbers in a particular column.This script is able to add the two zeros to the

OperationalError: (psycopg2.OperationalError) could not translate host name "143@postgres" to address: Unknown server error [duplicate]

I want to import a large csv file without creating table before for that csv file into postgresql. While searching on stackoverflow, one of th

Edit a value in a large csv file which appears multiple times

i have a large tab seperated csv file, about ~10GB, i need to edit all the "direct" words in a column named Tab2 with the value of the column Tab1 in the same r

How to get pandas to return the row index on which a CSV read error occurs

I have a CSV: '1\n2\na'. If I read it with something like pd.read_csv(io.StringIO('1\n2\na'), names=['A'], dtype={'A': 'float'}) specifying that the first colum

Python csv rearrange columns and calling from a dictionary (no pandas)

I need the code to rearrange the columns while changing the header names without using Pandas. I also need to omit some of the columns in the new csv file. Samp

Merging csv files deletes data

I need to choose and merge multiple csv files. All are in the same structure, however the name of file and sheets change. The separator is ; The code merges the

Error in executing YOLO .txt annotations to .csv converter

I'm having trouble executing this file. Given that I'm working on a multi-class classification, each .txt file has several lines addressing each object in every

Importing .csv content from gmail into gsheet - script works - content shows strange symbols

when running my script to import .csv content from gmail it works and runs fine without any errors. But the content within the sheet is off. Strange thing is sa

Converting non-conventional CSV into a compatible CSV

I got this kind of CSV which is not an CSV. Let me explain it. The output has column_name,value. e.g. created_at,2022-02-10T16:53:49+01:00 upd