Let's say I am trying to make a (Pandas) Series from 2 csv files that look like this:
A.csv (no column names)
28/05/2020 22:15,0.88
28/05/2020 22:30,0.85
28/05/2020 22:45,0.97
B.csv
28/05/2020 22:15,0.05
28/05/2020 22:30,0.12
28/05/2020 22:45,0.18
The array would have to look something like this:
[0.88,0.85,0.97,..., 0.05,0.12,0.18,..., timestamp(28/05/2020 22:15)]
So far i have come up with this to write the array:
datarow= pd.DataFrame
for k, v in datarow():
if k < 96:
data = pd.concat([A, pd.Series([v], index=[k])])
data.append(pd.Series(v,0), ignore_index=True)
elif k < 2*96:
data = pd.concat([B, pd.Series([v], index=[96-k])])
data.append(pd.Series(v,0), ignore_index=True)
else:
timestamp = v
When printed, it shows an empty array. What are possible solutions?
question from:
https://stackoverflow.com/questions/65944425/write-a-pandas-series-out-of-certain-csv-file-columns 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…