我有这样一个数据集:
category UK US Germany
sales 100000 48000 36000
budget 50000 20000 14000
n_employees 300 123 134
diversified 1 0 1
sustainability_score 22.8 38.9 34.5
e_commerce 37000 7000 11000
budget 25000 10000 10000
n_employees 18 22 7
traffic 150 mil 38 mil 12500
subsidy 33000 26000 23000
budget 14000 6000 6000
own_marketing 0 0 1
在数据集中,销售变量对应于总部的销售额。e_commerce
是e-commerce
的销售额,而e_commerce
之后的budget
实际上是公司e_commerce
部门的预算。这同样适用于subsisdy
,subsidy
变量对应于subsidy
的销售额,subsidy
之后的budget
变量是subsidy
的预算。我想把数据集转换成这样(如果我们以英国为例):
UK_main_sales UK_main_budget ... UK_e_commerce_sales UK_e_commerce_budget ...
100000 500000 37000 250000
等等。我试图通过跟踪budget
变量对来自不同部门的变量进行分类,因为它总是紧跟在离开者之后,但我没有成功。
英国变量的完整列表应如下所示:
UK_main_sales
UK_main_budget
UK_main_n_employees
UK_main_diversified
UK_main_sustainability_score
UK_e_commerce (we could also add sales but I think it is simpler without sales)
UK_e_commerce_budget
UK_e_commerce_n_employees
UK_e_commerce_traffic
UK_subsidy
UK_subsidy_budget
UK_subsidy_own_marketing
有什么想法吗
我认为需要:
相关问题 更多 >
编程相关推荐