All Questions
325 questions
0
votes
1
answer
74
views
Annotating each point on the graph on a loop with matplotlib
I am trying to annotate each point the graphs on the loop with the country but can not figure out how to di it in a loop.
Here is the code:
import pandas as pd
import matplotlib.pyplot as plt
import ...
0
votes
2
answers
83
views
Read multiple CSV using numpy loadtxt and for loop not working
I'm trying to output data in multiple CSV files using a for loop using the following code:
import numpy as np
# read multiple files
def show_datasets(filenames):
n = len(filenames)
data=[]
...
1
vote
1
answer
62
views
paste end of variable name based on i in for loop
I am trying to save each variable save_i (up to length(counter)) as a row in a csv file. Each save variable is defined in a while loop so I have save_1:save_i where i= length(counter). A portion of ...
0
votes
2
answers
81
views
Rewrite data from one csv file to another based on condition from the second file
I have 2 csv files.
The 1st one stores the data about people.The 2nd one stores one column of data with emails and phone numbers in this column (one row = phone number or email, not both).
The first ...
0
votes
2
answers
269
views
Appending multiple lines to CSV with for loop in python
I have written code to create a multiple line CSV file. For this purpose one column will write default values and the other columns will have blank values to be edited later.
What results from the ...
0
votes
0
answers
27
views
Hpw to add sl number to the generated csv file
data=query to fetch data from MySQL with for loop .
fileName="abcd/2022"
fieldNames = [
"SL NUMBER"
"NAME",
"PLACE",
"AGE&...
0
votes
0
answers
70
views
How to iterate every item from a list only once
So I am comparing 2 csv datasets with each other. Each set's first row is the title row. Each additional row has the values at a given time.
The timestamp has the index 1. My goal is to compare both ...
-1
votes
3
answers
276
views
adding multiple csv to an excel file with keeping the names of these csvs files
I am trying to collect multiple csvs files into one excel workbook and keeping the names of csvs files on each sheet but the loop can not save the sheet for each step and I only get only the last ...
0
votes
2
answers
130
views
How to read and manipulate multiple CSV files using pandas and for-loop?
I want to read a list of CSV files, for example exon_kipan.00001.csv, exon_kipan.00002.csv, exon_kipan.00003.csv, and exon_kipan.00004.csv (24 files in total), and then perform a series of operations ...
0
votes
2
answers
53
views
read a csv file and validate whether input parameter is in the csv file then bypass the purge process otherwise initiate purge process using python
sample csv file:
test.csv
process_cd
ramsize
dbsize
protocal
random
function will be called with below parameters
self.complete_stage_purge_process(self.targetCnxn, self.targetTable, self.processCode)...
0
votes
2
answers
66
views
How to extract updated dictionary value from nested for loop?
I am trying to get a list of objects with updated value for a key with each iteration. I need this done for each dict in a list of dicts.
I tried to do this by iterating through each color, and within ...
1
vote
1
answer
197
views
I can't put elements found with Selenium's Xpath in Python in a list and export to CSV
"""
My code is to enter a news site and extract with Xpath all the titles, subtitles and links of the articles, then put them in lists and export them in CSV.
But in the exported CSV it ...
0
votes
1
answer
25
views
Importing CSV in Python - why does a for loop over 'data' affect list(data) after it?
I'm importing a simple CSV file. I want to print its content line-by-line and then print it once again, but now as a list of lists representing each line. The following code:
fo = open('filename.csv', ...
0
votes
0
answers
64
views
Why is the execution not entering the loop while reading the .csv file?
I am having a problem while reading a .csv file.
def isPresent(self, stid):
with open('D:\First_Sem_Project\Student\Student.csv', 'r', newline='') as file1:
reader = csv.reader(file1)
...
1
vote
3
answers
55
views
In Python why is my "for entry in csv_compare:" loop iterating only once and getting stuck on the last input
I'm trying to compare 2 csv files and then put the common entries in a 3rd csv to write to file. For some reason it iterates the whole loop for row in csv_input but the entry in csv_compare loop ...