All Questions
1,638
questions
-1
votes
0
answers
38
views
Comparing Input Variables to Text (and CSV) Files - Python
I am trying to receive an input from a user in a Python program, and compare it with a text file. I am learning about comparing data files, and need some help.
First I import the data:
import csv
...
0
votes
3
answers
53
views
Reading CSV Files And Stripping Values
I am currently new with coding in Python with CSV files, and need help with the following code:
import csv
import random
# Initialize an empty list to store the CSV variables
CSVars = []
# Read the ...
0
votes
1
answer
35
views
read in .csv files into a list using a character vector for filenames
I'm reading in a list of .csv files but they're coming in with a single column when in actuality the .csv files have many columns. How can I specify the delimiter is "," when using an ...
-2
votes
1
answer
64
views
Replacing a row value in csv with a value from a scrape function
I have a script that opens two csv files. It scrapes the links in venues.csv for an id value for a beer from a webpage, then uses that id to find corresponding data from the beer.csv and then writes ...
1
vote
0
answers
61
views
Add value in dictionary with inner dictionary [duplicate]
Could you please help with the following problem.
I have a dictionary with the following structure:
{'logtype16777217': {'Table_AmfSetID.csv': [],
'Table_QCI.csv': [],
'Table_body.csv': [],
'...
0
votes
1
answer
50
views
What does happen when a python list is added as a row element in a csv file?
I'm structuring a csv CRUD in Python and eventually I needed to save Python lists in a "cell" of a table. The saving succeeded as I'm able to read the cell as the Python list that it is.
...
2
votes
3
answers
80
views
List to csv Python
When I try to save a Python list in a csv, the csv have the items that I want to save separated by each character.
I have a list like this with links:
links = ['https://www.portalinmobiliario.com/MLC-...
1
vote
1
answer
46
views
Join Folder Path to File Name from .csv Import
I am trying to write a program that will take in a CSV file containing 1 column of file names, append a source,then destination file path, then move those select files to the destination folder.
Csv ...
-3
votes
3
answers
145
views
How to filter list in python based on index value?
Let's say I have 2 lists documenting the number of apples each person eats per day:
people = ['George', 'George', 'George', 'Dana', 'John', 'John']
apples_eaten = [5, 1, 3, 4, 3, 3]
In this scenario, ...
-1
votes
1
answer
31
views
Python: Generate new Lists with Random Unique Numbers using a given Dataset Progression
I have the following lists (as a dataset in a CSV file). Some lists contain consecutive, non-repetitive integer numbers and others contain non-repetitive integer numbers.
If we observe, there is a ...
0
votes
4
answers
75
views
split by comma and ignore if comma in quotes a data from List of Tuples - Python
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 ...
-2
votes
1
answer
60
views
Python write elements without comma and brackets
I have a list of names as elements in an array (read from a csv file), I want to split the names at the spaces and write it into a csv file. But whenever I do it, it writes it always with brackets and ...
-1
votes
2
answers
64
views
Python csv file not printing properly, for Text Based Game
So creating this text based game, currently just sorting out some fundamentals, when printing out the classes stats the knight class prints out totally fine but the mage class for some reason prints ...
0
votes
1
answer
39
views
`.merge()` with a list in column
Is it possible to pd.merge() a df and csv when the df column is a list (could be more than one variable) and the csv only one.
df
GV2015_VAL polName
0 605000.0 ...
-1
votes
1
answer
372
views
How to make the width and height bigger in csv output file
I've tried to search online, but with no sucesess.
I have an output code which I try to export as csv file after modulations.
When I open the exported file the width and height are just too small it ...