csv

How can i read csv from zip file python?

How can i read csv from zip file python? Question: I am trying to read csv which is in zip file. My task is to read the file rad_15min.csv file but the issue is when i read zip file (I copied link address by clicking on download button) it gives me error: Code: import pandas …

Total answers: 2

How to add a CSV file to a Blob service using Durable Functions

How to add a CSV file to a Blob service using Durable Functions Question: In Azure Durable Functions, I would like to write additionally to the CSV in the Blob service. What I would like to do Select a CSV file to be written by the Blob service. Create a data frame Add a data …

Total answers: 1

split by comma and ignore if comma in quotes a data from List of Tuples – Python

split by comma and ignore if comma in quotes a data from List of Tuples – Python Question: I have a list of tuples. lt = [(‘051623’, ‘O143’, ‘1.23’, ‘2023-05-16T18:30:00’, ‘1M allen’, ‘millan’), (‘051623’, ‘O207’, ‘1.23’, ‘2023-05-16T18:35:00’, ‘nM Mn, 4nM, 35uM Fe’, ‘wilo’)] Need to convert to csv string by comma separated but while split …

Total answers: 4

Plot with low resolution curves

Plot with low resolution curves Question: My problem requirement is to redraw a graph with curves at low resolution. As shown below: Is there a way to do it with matplotlib library or any image processing solution? Currently matplotlib is producing lines with very high smoothness as shown below: Here is the drawing function I …

Total answers: 1

Averaging numeric values of all files for three different folders using Python

Averaging numeric values of all files for three different folders using Python Question: I am trying to average the numeric values in the file for each var. It works fine for var_values=1.0 but it is not working for var_values=5.0,10.0. I present the current output. The expected output should have numeric values for var_values=5.0,10.0 as each …

Total answers: 1

Read .csv file with columns of varying length as dictionary in Python

Read .csv file with columns of varying length as dictionary in Python Question: How do I read in a .csv file in Python with columns of varying lengths? I want to create a dictionary from the .csv file, with the .csv columns as lists of dictionary values. I’ve figured out how to write the dictionary …

Total answers: 3

Refactoring pandas using an iterator via chunksize

Refactoring pandas using an iterator via chunksize Question: I am looking for advice on using a pandas iterator. I performed a parsing operation using Python pandas, the size of the input files (a bioinformatics program called eggNOG) is resulting in ‘RAM bottleneck’ phenomenon. It’s just not processing the file. The obvious solution is to shift …

Total answers: 2

creating a .csv from a combination of strings and panas dfs

creating a .csv from a combination of strings and panas dfs Question: my .csv with multiple blocks need to follow this format (1 block sample): so trying to do it in pandas and then write to csv. The problem is those comments above each of the two sections(outside the dataframes). Here is sample code: import …

Total answers: 1

Is there a Python module to handle csv files with sections?

Is there a Python module to handle csv files with sections? Question: I’m seeing more and more csv files containing multiple sections, each containing their own table. For instance this file from 10XGenomics: [gene-expression] reference,/path/to/transcriptome [libraries] fastq_id,fastqs,feature_types gex1,/path/to/fastqs,Gene Expression mux1,/path/to/fastqs,Multiplexing Capture [samples] sample_id,cmo_ids sample1,CMO301 sample2,CMO303 Sometimes the section headers are even embedded in their own …

Total answers: 3