1

例如,同一“自来水市场,RoW”活动的多个输入在工业过程中用于不同目的。导入数据库时​​,这些输入的数量是否会自动汇总在一个“自来水市场,RoW”活动中?

谢谢!

[编辑]我添加了一个代码示例以更好地说明问题:

##the goal is to use a dict to categorize the inputs of the activity "market for tap water, RoW" by industrial classifications. 
##For example, there could be 200+ upstream activities under the classification "3510b: Electric power generation, photovoltaic" 
##using this particular tap water activity. Then the results will be "d['3510b...']=[1E-5, 2E-7,...].

#get tap water of interest
tap_water=db.search('tap water',filter={"location":"row"})[0]
#create a dict to store classifications 
facet_store=defaultdict(list)

#find the upstream activities
for exc in tap_water.upstream():
    temp_classification=exc.output["classifications"]
    flat_classification_list=[el for tuuple in temp_classification for el in tuuple]
    temp_locator=flat_classification_list.index("ISIC rev.4 ecoinvent") #keyword for location
    key_classification=flat_classification_list[temp_locator+1] #actual classification is always immediately after this keyword
    facet_store[key_classification].append(exc["amount"]) #append the input amount of tap water to each upstream activity to the list

问题是如果上游活动不止一次使用“自来水市场,RoW”怎么办。这是否意味着此上游活动将在 for 循环中多次显示为“exc”?

4

1 回答 1

0

不,这样的总结需要工作,而懒惰是程序员的美德。为了处理多个不确定性分布,或者只是为了使数据集更清晰(例如,对于任何有损失的活动,我们有相同的东西,其中有一个生产交换和一个消费交换相同的流量),保持这种交换分开是必要的。

于 2019-11-06T22:25:21.867 回答