All Questions
404 questions
0
votes
1
answer
78
views
Reading an irregular column CSV file using Pandas causes errors
I have a csv file,
"==CNAME=="
""
"Tool Name","v2.1"
"Name:","MATT B"
"E-Mail:","[email protected]"
"Phone Number:&...
-2
votes
2
answers
103
views
Specific section of string comma separated [closed]
I have a csv file with some numbers and words. Example,
Header
1 This is the first line.
This is the second line.
3 4 This is the third line.
5 6 7 This is a special line.
Trying to separate these ...
-1
votes
3
answers
60
views
I am not able to get print of desired string from this code......it works in pycharm but not in vs code. I dont't understand what is wrong here?
enter image description here
I am getting this result in vs code but it is working in Pycharm and I have used the complete path of the file in both softwares...
what should i do?
is there some setting ...
0
votes
1
answer
149
views
Print data of csv file after specific string is found
I am quite new to Python and eager to learn.
I want to open and use data from a csv file, but only use the data (four columns of values, seperated by ",") after a specific string (s,s,N,s).
...
0
votes
1
answer
397
views
Speeding up the code for downloading data from Telegram and saving it to a CSV file
I implemented the following function, which I would like to speed up as much as possible:
async def async_update_database(self, source_id: str, source_hash: str, message_id_1: str, message_id_n: str, ...
1
vote
1
answer
551
views
Converting .dat files (inconsistent spacings and delimiters) to .csv files
I am trying to read the Computer and Internet Use data from this link. The datasets in 2019 and 2021 are provided as .csv, .dta, and .dat, which is very convenient.
However, the datasets prior to 2019 ...
2
votes
1
answer
102
views
Within extracting text from PDF to txt file the resulting txt file contains double quotes in some lines that I cannot get rid of
When I try to extract text from a PDF to txt file in some cases some lines are clutched with double quotes "" for a reason I do not understand. The problem lies most likely in the way I ...
1
vote
1
answer
156
views
Detect data in txt files, string parse and output as csv file
this is my code. I am working on use code detected a bunch of text files in a folder and then string parse the data output as csv files. Could you please give me some hint on how to do this? I am hard ...
0
votes
0
answers
22
views
How can i read a csv file from a string while i compiled from info in an email? [duplicate]
Im looking to access a csv file from a string which i have compiled from contents in python from an outlook email and some pre defined things.
Basically the file location gets defined below as ...
1
vote
1
answer
90
views
Why is my string being converted to a tuple when I append it to my list? [closed]
I am reading lines from a csv file and using that to initiate instances of a VM class, which is then appended to a list, called vm_list. I have two different ips being appended, "ip_address" ...
1
vote
1
answer
342
views
Pandas string reassignment errors when read from csv but not xlsx
I'm using pandas to read in two datasets and reassign the value column of each. One dataset is a csv, loaded with pd.read_csv(), and the other is xlsx, loaded with Workbook.sheets() from the sxl ...
3
votes
3
answers
167
views
How can I create a Dataframe based on an unstructured CSV file in Python?
I have a very messy csv file in Python and I need to extract some relevant information from it.
Basically, there are 2-3 things that I need there: (1) two numbers separated from comma, positioned in ...
0
votes
0
answers
41
views
Unable to convert string to float in Python [duplicate]
I'm working with a csv file and one of the columns needs to be converted over to float. This row is giving me an error:
2020-10-26,B5,"1,315.89",,10.55,"1,618.87",,"1,911.11&...
0
votes
0
answers
32
views
Using Pandas in Python: Splitting one column into three with possible blanks?
Right now, I'm working with a csv file in which there is one column with a string.
This file is 'animals.csv'.
Row,Animal
1,big green cat
2,small lizard
3,gigantic blue bunny
The strings are either ...
1
vote
2
answers
93
views
read line and split line of csv file but has comma in a cell
I have a string line and tried split with the delimiter ','
tp = 'A,B,C,"6G,1A",1,2\r\n'
tp.split(',')
and get the results as with the length of 7
['A', 'B', 'C', '"6G', '1A"', '1',...