2024-09-20 09:26:39 +08:00
|
|
|
import pandas as pd
|
|
|
|
import random
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
# 生成170条测试数据的函数
|
2024-09-21 22:39:09 +08:00
|
|
|
data = pd.read_csv('input_data/BomNodes.csv')
|
2024-09-20 09:26:39 +08:00
|
|
|
# 生成数据
|
|
|
|
df = pd.DataFrame(data)
|
|
|
|
df['产业种类'] = [random.choice([0, 1]) for _ in range(107)]
|
|
|
|
|
|
|
|
# 显示前几行
|
|
|
|
|
|
|
|
# 保存数据到CSV文件
|
|
|
|
df.to_csv('input_data/测试 BomNodes.csv', index=False)
|