Changes:增加了自动生成修改数据变csv的格式
This commit is contained in:
3
.idea/python_project.iml
generated
3
.idea/python_project.iml
generated
@@ -5,4 +5,7 @@
|
|||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="PyDocumentationSettings">
|
||||||
|
<option name="renderExternalDocumentation" value="true" />
|
||||||
|
</component>
|
||||||
</module>
|
</module>
|
||||||
2815
1_disturb.csv
2815
1_disturb.csv
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from cycle import cycle
|
from cycle import cycle
|
||||||
|
|
||||||
filepath = "D:/python_project/1.csv"
|
filepath = "D:/python_project_data/1.csv"
|
||||||
origin_data = pd.read_csv(filepath)
|
origin_data = pd.read_csv(filepath)
|
||||||
row_len = origin_data.shape[0]
|
row_len = origin_data.shape[0]
|
||||||
cow_len = origin_data.shape[1]
|
cow_len = origin_data.shape[1]
|
||||||
@@ -9,12 +9,16 @@ disturb_data = origin_data
|
|||||||
algorithm_step = cycle()
|
algorithm_step = cycle()
|
||||||
|
|
||||||
cow_name = "G1.TTXD1_3"
|
cow_name = "G1.TTXD1_3"
|
||||||
|
contrast_data = pd.DataFrame()
|
||||||
|
contrast_data[cow_name+'_origin'] = origin_data[cow_name]
|
||||||
algorithm_step.set_config('{"CYCLE_AMPLITUDE_BASE": 200 , "CYCLE_TIME_BASE": 5 ,"CYCLE_START_ANGLE_BASE": 3.14}')
|
algorithm_step.set_config('{"CYCLE_AMPLITUDE_BASE": 200 , "CYCLE_TIME_BASE": 5 ,"CYCLE_START_ANGLE_BASE": 3.14}')
|
||||||
# algorithm_step.set_config('{"CYCLE_TIME_BASE": 5 }')
|
# algorithm_step.set_config('{"CYCLE_TIME_BASE": 5 }')
|
||||||
for i in range(0,row_len):
|
for i in range(0,row_len):
|
||||||
disturb_data.loc[i,cow_name]=algorithm_step.eval(origin_data.loc[i,cow_name],i)
|
disturb_data.loc[i,cow_name]=algorithm_step.eval(origin_data.loc[i,cow_name],i)
|
||||||
print(disturb_data)
|
print(disturb_data)
|
||||||
disturb_data.to_csv("D:/python_project/1_disturb.csv", index=False)
|
contrast_data[cow_name+'_disturb'] = disturb_data[cow_name]
|
||||||
|
disturb_data.to_csv("D:/python_project_data/1_disturb.csv", index=False)
|
||||||
|
contrast_data.to_csv("D:/python_project_data/contrast_data.csv", index=False)
|
||||||
|
|
||||||
|
|
||||||
# 以下均为测试性能用
|
# 以下均为测试性能用
|
||||||
|
|||||||
Reference in New Issue
Block a user