Category "csv"

CsvHelper mapping issue

I have a question related to CsvHelper library and I cannot figure out how to map a csv file to the following MyClass object. the csv file look like: id, Proper

Streamlit Panda Query Function Syntax Error When Finding Column in CSV Dataframe

When Using Streamlit to build a data interface getting a syntax error. My downloaded csv dataframe has a column 'NUMBER OF PERSONS INJURED', after converting i

How to check if a CSV has a header using Python?

I have a CSV file and I want to check if the first row has only strings in it (ie a header). I'm trying to avoid using any extras like pandas etc. I'm thinking

pandas read_csv() method supports zip archive reading but not to_csv() method supports zip archive saving

Pandas 0.18 supports read_csv zip file as argument and reading zipped csv table correctly into data frame. But when i am trying to use to_csv() method to save d

Powershell for creating folders and subfolders from csv

I try to prepare a script that will create folders and subfolders from CSV. When I create a CSV with 1 column 'Name' like so Name XYZ ZXX FFF with the follo

How can i find the "non-unique" rows?

I imported CSV files with over 500k rows, one year, every minute. To merge two of this files, i want so re-sample the index to every minute: Temp= pd.read_csv(

Convert csv to parquet file using python

I am trying to convert a .csv file to a .parquet file. The csv file (Temp.csv) has the following format 1,Jon,Doe,Denver I am using the following python

How can i fill in missing csv file value base on reference csv file

I have a reference file like this Id, Value1, Value2 a, a1, a2 b, b1, b2 c, c1, c2 d, d1, d2 ... n, n1, n2 and the missing file Id, Value1, Value2 d, ,

Parsing in memory CSV files from zip archives

I'm working on a new library which will allow the user to parse any file (xlsx, csv, json, tar, zip, txt) into generators. Now I'm stuck at zip archive and when

How to solve error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 106: invalid continuation byte in tensorflow

I need help to deal with an error... I try to create an object detection program with a tutorial made by lazy tech on Youtube. This tutorial use this repo on gi

Parse CSV records in to an array of objects in JavaScript

I'm new to JS and not much exp in Regex to play with string manipulation. Here is my CSV file with records in tabular form with the first line as headers and

Convert JSON to CSV and maintain column order

I need to convert json to csv for an inventory feed with no headers and I have no problem with the conversion but the column order is getting changed. Is there

R- import CSV file, all data fall into one (the first) column

I'm new, and I have a problem: I got a dataset (csv file) with the 15 columns and 33,000 rows. When I view the data in Excel it looks good, but when I try t

How to rename key/header in csv DictReader

For instance given mycsv.csv file h1,h2 a,b c,d how to rename h2 onto HTwo with reader reader = csv.DictReader(open('mycsv.csv')) (Additionally how to wr

How to select several rows when reading a csv file using pandas?

I have a very large csv file with millions of rows and a list of the row numbers that I need.like rownumberList = [1,2,5,6,8,9,20,22] I know there is somethi

Pandas: ValueError: cannot convert float NaN to integer

I get ValueError: cannot convert float NaN to integer for following: df = pandas.read_csv('zoom11.csv') df[['x']] = df[['x']].astype(int) The "x" is a column i

Pandas read csv not reading a file properly. Not splitting into proper columns

So I'm trying to read in this dataset from Kaggle. https://www.kaggle.com/gmadevs/atp-matches-dataset#atp_matches_2016.csv I'm using pandas' read_csv functio

Pandas read csv not reading a file properly. Not splitting into proper columns

So I'm trying to read in this dataset from Kaggle. https://www.kaggle.com/gmadevs/atp-matches-dataset#atp_matches_2016.csv I'm using pandas' read_csv functio

Adding timestamp index column with a column header to existing csv (python)

#gets rid of spaces in existing csv headers def getColumns(readCSV): return [column.replace(' ','') for column in next(readCSV)] #insert format used to

Looping using dataweave

my input xml: <Root> <Element> <Record att="a">value</Record> <Record att="b">value</Record>