All Questions
1,095 questions
-1
votes
1
answer
64
views
Can't get grouped data into numpy array
I have a CSV file like this:
Ngày(Date),Số(Number)
07/03/2025,8
07/03/2025,9
...
06/03/2025,6
06/03/2025,10
06/03/2025,18
06/03/2025,14
...
(Each day has 27 numbers)
I want to predict a list of 27 ...
1
vote
1
answer
63
views
CSV file not generating in expected folder. Prints out in terminal window
import requests
import pandas as pd
import numpy as np
import os
print("Saving file to:", os.getcwd())
# Define the URL
URL = "https://web.archive.org/web/20230902185326/https://en....
-2
votes
2
answers
157
views
Python large-scale data format for distributed writing, reading, and storing on AWS
I'm trying to figure out the best way to write, read, and store data on AWS using a conventional Python data format. From my various Googling, I wasn't able to find a conclusive list of Big O notation ...
0
votes
1
answer
84
views
iterate through a csv file using numpy
I have a CSV file with 4 columns with x, y positions for tracks.
The 1st column is the ID of the track. The 2nd column is time. 3rd and 4th are X & Y co-ordinates.
Now the X & Y positions ...
2
votes
2
answers
70
views
Save 2 variables from an array to .csv
I have 2 coordinate variables lon and lat
(array([-50.940605, -37.424145, -41.501717, -37.98916 , -60.632664,
-38.158283, -58.0372 , -39.06596 , -60.815792, -49.303684,
-38.46074 , -50....
0
votes
0
answers
62
views
Maintain numpy array data type when reloading data
Say you create a dataframe like this, where one column contains a numpy array:
data = {'col_1': [np.array([1,2,3])], 'col_2': 3}
x = pd.DataFrame.from_dict(data)
Then you write it to csv and (in a ...
0
votes
2
answers
82
views
finding equal values in 2 CSV files with python [duplicate]
I have 2 excel files, each containing 2 columns like below:
file1:
name price
a 1
b 78
f 54
g 32
t 2
file2:
name price
f 4
x 23
e 76
a ...
1
vote
1
answer
78
views
How to create multiple combined csv files out of a multi-dimensional numpy arrays
I have 8 numpy arrays of the dimensionalty (number_of_buildings, number_of_weeks) which in my example is (2, 20). They look like that:
import numpy as np
...
0
votes
0
answers
77
views
How can I match rows of 2 files with specific rules by Pandas
There are 2 .csv files. I need to take each line from file A and go through each line of file B, looking for the best match. Here is a code snippet of how it works now:
for row2 in file2:
...
0
votes
1
answer
162
views
np.genfromtxt value error on python (with csv. file)
current_account = np.genfromtxt(fname = "q3_1_current_account.csv",delimiter = ",")
current_account
I want to upload a csv file to my python, but it makes an error.
---------------...
3
votes
1
answer
84
views
Python is writing empty lists from cvs file DictReader data in Python 3.10
So I have written this piece of code which is meant to read a csv file and write the data to a dictionary with keys "key1" "key2" "key3" "key4" with values ...
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
votes
2
answers
2k
views
How to select rows based on column values of a CSV file in Python [duplicate]
I want to select only rows that have fc_id == 2, and then delete those having duplicates. This is my input file:
I have been stuck on the first step only. After that I also need an output file where ...
0
votes
0
answers
65
views
Trying to remove a name from columns in a dataset (csv file) then recreate the dataset
I have a big dataset of columns filled with names of people applying to different companies-- each company ranks the people on which ones they want (not all the same people applied to each company. ...
0
votes
1
answer
80
views
Pandas to Numpy: why is the last line of CSV file column missing?
Very simple problem. I am reading in CSV files organized in specific way. There's no header and the file shape is a rectangle; there are no missing or corrupt entries. I read in the csv file using ...