csv

Filtering a DataFrame by comparing to another DataFrame

Filtering a DataFrame by comparing to another DataFrame Question: I’m very new to using Python, and have been working on a script that will allow me to download a csv, clean the data and create an output file that can be imported correctly into a shopify store. So far, I’ve managed to accomplish this, generating …

Total answers: 1

How to use Arduino to fetch values output by Python script?

How to use Arduino to fetch values output by Python script? Question: I have a GUI that was created using the PySimpleGUI package in Python. Based on user selection from a dropdown menu, the script writes 4 integers to a csv file. (For example, the user selects option A, and the script writes (20, 30, …

Total answers: 1

Split a csv file into multiple files based on a pattern

Split a csv file into multiple files based on a pattern Question: I have a csv file with the following structure: time,magnitude 0,13517 292.5669,370 620.8469,528 0,377 832.3269,50187 5633.9419,3088 20795.0950,2922 21395.6879,2498 21768.2139,647 21881.2049,194 0,3566 292.5669,370 504.1510,712 1639.4800,287 46709.1749,365 46803.4400,500 I’d like to split this csv file into separate csv files, like the following: File 1: time,magnitude …

Total answers: 4

Read CSV file with skip rows until we find certain no of columns using python

Read CSV file with skip rows until we find certain no of columns using python Question: I want to read CSV file using python by skiprows dynamically after condition. Condition – whenever I found 6 cols in CSV read from there or either when i find col names sequence as those 6 cols. File.csv Col1,col2,col3 …

Total answers: 3

Creating a csv file with measurement data and meta data in the first line

Creating a csv file with measurement data and meta data in the first line Question: I want to save measurement data I receive via the CAN bus in a csv file. Apart from the measurement data I want to also store some meta data I need to convert the measurement data I receive via CAN. …

Total answers: 1

Create a single-column from a pandas data frame with n columns

Create a single-column from a pandas data frame with n columns Question: I have a data frame with 3 columns: A, B and C as below: A: 1 2 3 B: 10 20 30 C: 100 200 300 I need to save the values only in a csv file in "one" row like this ( …

Total answers: 1

How to read a csv with a broken header in pandas?

How to read a csv with a broken header in pandas? Question: I have a problem with opening CSV file using Pandas in Jupyter and then I tried to open it in Visual studio and it’s also not working. What am I missing? Code in Jupyter: path = ‘data/DATA_vozila_RAW.csv’ df = pd.read_csv(path) I also tried …

Total answers: 1

How to write to csv a dataframe with config line before headers

How to write to csv a dataframe with config line before headers Question: I’m using a pyhton script to manage different logfiles from an acquisition system, boards ecc. I’m building a big dataframe which is the merge of other dfs and at the end i’m putting it to a csv file, below last line: dF_COMP.to_csv(path1 …

Total answers: 1

Preserving special characters when writing to a CSV – What encoding to use?

Preserving special characters when writing to a CSV – What encoding to use? Question: I am trying to save the string the United Nations’ Sustainable Development Goals (SDGs) into a csv. If I use utf-8 as the encoding, the apostrophe in the string gets converted to an ASCII char import csv str_ = "the United …

Total answers: 1