Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F87925612
process_synthetic_data.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Oct 15, 19:08
Size
612 B
Mime Type
text/x-python
Expires
Thu, Oct 17, 19:08 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
21683475
Attached To
rMLECMO Machine Learning ECMO
process_synthetic_data.py
View Options
import
csv
import
numpy
as
np
import
pandas
as
pd
def
interpolate
(
path
,
mode
,
n
):
print
(
"
\033
[1;37;48m Interpolating missing values in the file "
,
str
(
n
),
'...'
)
df
=
pd
.
read_table
(
path
+
'files_missingdata_'
+
str
(
i
)
+
'/'
+
mode
+
'/input/file_0.txt'
,
delimiter
=
' '
,
dtype
=
'float32'
,
header
=
None
)
df
=
df
.
apply
(
lambda
x
:
x
.
interpolate
(
method
=
'index'
,
axis
=
0
,
limit_direction
=
'both'
))
.
astype
(
float
)
print
(
df
.
head
(
5
))
#df.to_csv(path + '/Signals' + str(i) + '.txt', sep=';', header=False)
path
=
'../../synthetic_data/'
mode
=
'train'
interpolate
(
path
,
mode
,
30
)
Event Timeline
Log In to Comment