All Questions
125 questions
2
votes
1
answer
55
views
apply to pandas columns doesn't give the correct results
I have this file.
If I read it and do some clean up with regex:
import pandas as pd
import re
df = pd.read_csv('data.csv', index_col=[0])
out = df[['X', 'Y']].apply(lambda s: s.str.extract(r'([a-z\d]+...
-2
votes
1
answer
65
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 ...
0
votes
1
answer
40
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
700
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 ...
0
votes
1
answer
86
views
Data extraction with pandas or lists?
(Full disclosure - relative beginner with Python programming AND Pandas, however, am able to pick up things quickly and absolutely LOVE playing with / manipulating data to get what I want!)
Hey there ...
0
votes
1
answer
47
views
Extracting n Number of Words from Pandas Series
I have a pandas data frame with about 2000 rows I have to do some work on and I’m stuck on one column. The column consists of comma separated words. What I need to do is to trim these words so only ...
0
votes
1
answer
53
views
Facing issues while creating a dataframe from a list of string
I have a list with a following format:
lst = ['"column1","column2","column3","column4","column5","column6","column7"',
'"A&...
0
votes
1
answer
87
views
Read text or CSV file and break into groups separated by space
I have a .csv file with data as:
20
40
25
50
60
80
10
25
34
75
50
50
60
I need to read this file and create groups of numbers whenever a blank value is found. Hence, for the example above, it ...
0
votes
1
answer
35
views
Getting index of list within a dictionary
I have created a key:value pair from a csv, where the value is actually a list of all the rows of data, i.e
has now become:
Date ['04-Nov-22', '05-Nov-22']
USD [0.9872, 2.9872]
JPY [145.19, 11115.19]
...
0
votes
1
answer
463
views
CSV forgetting some columns when added to ArcGIS Pro
In the first photo []. I have all the columns I have desired (which the example I will talking about is Project Scope) in an Excel CSV file. When I go to add the the CSV into ArcPro (second photo) ...
0
votes
1
answer
79
views
CSV files seperated by dot instead of comma. Panda, Python
when I merge three lists into one and then use pandas to create a dataframe and then create a CSV the CSV created has the lists values separated by a dot instead of a comma.
The code :
qup = []
for i ...
0
votes
1
answer
50
views
Modifying the function in Python ( NLP)
final_list = [ ]
words = ['good', 'bad', 'excellent','delivery', 'quality','upset','better','poor','refund','fake','cheat','quick','long','scam','cheaper','aluminium']
def func(words, list1):
cnt = ...
0
votes
3
answers
136
views
How to transform a csv file into a multi-dimensional list using Python?
I started out with a 4d list, something like
tokens = [[[["a"], ["b"], ["c"]], [["d"]]], [[["e"], ["f"], ["g"]],[["h"], [...
1
vote
1
answer
97
views
How to quickly batch remove roman numerals from csv file
Currently, I'm removing the Roman numerals in some csv files with the following Python code:
def inplace_change(filename, old_string, new_string):
# Safely read the input filename using 'with'
...
1
vote
1
answer
103
views
.tolist() converting pandas dataframe values to bytes
I read a csv file in as a pandas dataframe but now need to use the data to do some calculations.
import pandas as pd
### LOAD DAQ FILE
columns = ["date","time","ch104",&...