<jupyter_start><jupyter_text>Sanity checkThe WRI database reports on ≈34k power plants making up more than 80% of global installed capacity according to their technical note linked [here](https://pdfs.semanticscholar.org/3859/3d64639f710604add94b63d052456dee4b91.pdf). Since the mean capacity of these 34k plants is roughly 170 MW and the total capacity is ≈6e6 MW = 6 TW, we can multiple by 8760 hrs/yr to get ≈52,000 TWh. This is about 1/4 of global production according to [Our World In Data](https://ourworldindata.org/energy-mix:~:text=We%20see%20that%20in%202019,and%204.3%25%20came%20from%20nuclear.) which is using BP sourced data. This difference might make sense since we are missing 20% of capacity and because this power plant data does not include enery production/consumption outside power plants, e.g. in cars, planes and trucks. If we take the total generation data from the WRI DB as of 2017, we get 7e6 GWh or 7e3 TWh. Not positive this all works out. Needs more thought.<jupyter_code># Not all the power plants are emissive! Let's see what fraction of the DB is. 

power_plant_df.primary_fuel.unique()
emissive_sources = ['Gas', 'Oil', 'Coal', 
       'Waste', 'Biomass', 'Petcoke',]
mask = power_plant_df.primary_fuel.isin(emissive_sources)
sub_df = power_plant_df[mask]
print("{0:d} emissive power plants in DB".format(sub_df.capacity_mw.size))
print("Mean emissive capacity {0:.2g} MW".format(sub_df.capacity_mw.mean()))
print("Total emissive capacity {0:.2g} MW".format(sub_df.capacity_mw.sum()))
print("{0:.2g}".format(1e5*1e5*1e-4*3e7))<jupyter_output>3e+13
{'fraction_non_alphanumeric': 0.10366624525916561, 'fraction_numerical': 0.06573957016434892, 'mean_word_length': 5.595833333333333, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '257681', 'license': 'MIT', 'n_tokens_mistral': 607, 'n_tokens_neox': 525, 'n_words': 181, 'path': 'code/analysis/power-plants.ipynb', 'repo_name': 'ilopezgp/human_impacts', 'size': '1582'}