This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Extract coal electricity generation (TWh) by year from Ember data. | |
| China coal can use monthly or yearly data; World uses yearly. | |
| """ | |
| import argparse | |
| import pandas as pd | |
| from pathlib import Path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| date | category | target | location | summary | attribution_reported | sources | |
|---|---|---|---|---|---|---|---|
| 1984-03-24 | Bombing (aerial) | Bushehr nuclear power plant (under construction) | Bushehr, Iran | Iraq conducted an air raid on the Bushehr nuclear power plant during the Iran–Iraq War (reported as one of several strikes). | Iraq | https://www.npolicy.org/article.php?aid=1188&rid=4 ; https://www.iaea.org/sites/default/files/infcirc341.pdf | |
| 1987-11-17 | Bombing (aerial) | Bushehr nuclear power plant (under construction) | Bushehr, Iran | Iraqi air attack on Bushehr reported by Iran to the UN; part of repeated strikes on the site during the war. | Iraq | https://docs.un.org/en/A/42/829 ; https://www.upi.com/Archives/1987/11/17/Iraqi-warplanes-twice-bombed-an-unfinished-nuclear-power-plant/3564564123600/ | |
| 2010-01-12 | Assassination | Masoud Ali‑Mohammadi (scientist described by Iran as linked to nuclear work) | Tehran, Iran | Killed by a remote‑controlled bomb (reported attached to a motorcycle). | Iran blamed U.S./Israel; attribution disputed | https://www.reuters.com/article |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| url = "https://sdmx.oecd.org/public/rest/data/OECD.ELS.HD,DSD_HEALTH_LVNG@DF_HEALTH_LVNG_AC,1.0/.A.....?dimensionAtObservation=AllDimensions&format=csvfilewithlabels&startPeriod=1960" | |
| df = pd.read_csv( | |
| url, | |
| storage_options={ | |
| "User-Agent": "Mozilla/5.0" | |
| } | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| State | Average Wedding Cost | Average Marriage Length | |
|---|---|---|---|
| Alabama | 34000 | 20.3 | |
| Arizona | 32000 | 20.6 | |
| Arkansas | 25000 | 19.4 | |
| California | 41000 | 19.9 | |
| Colorado | 34000 | 17.9 | |
| Connecticut | 44000 | 21.4 | |
| Delaware | 39000 | 21.9 | |
| DC | 42000 | 10.8 | |
| Florida | 34000 | 20.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| decade | global_stations | tv_power_escaping_mw | radio_power_escaping_mw | seti_detectable_mw | total_anthropogenic_rf_mw | |
|---|---|---|---|---|---|---|
| 1920s | 5 | 0.0005 | 0.005 | 0.0055 | 0.01 | |
| 1930s | 15 | 0.003 | 0.25 | 0.253 | 0.05 | |
| 1940s | 55 | 0.2 | 0.5 | 0.7 | 1 | |
| 1950s | 550 | 5 | 1 | 6 | 5 | |
| 1960s | 3000 | 30 | 2 | 32 | 40 | |
| 1970s | 7500 | 75 | 3 | 78 | 100 | |
| 1980s | 12500 | 125 | 4 | 129 | 165 | |
| 1990s | 17500 | 175 | 5 | 180 | 260 | |
| 2000s | 22500 | 125 | 6 | 131 | 300 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| from io import StringIO | |
| import numpy as np | |
| import pandas as pd | |
| import matplotlib | |
| matplotlib.use("Agg") | |
| import matplotlib.pyplot as plt | |
| from matplotlib.colors import LinearSegmentedColormap | |
| DATA = """pasta\tbox time\tactual al dente\tdifference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install.packages("readr", quiet = TRUE) | |
| library(readr) | |
| data https://mqscores.wustl.edu/measures.php | |
| justices_df <- read_csv("justices.csv") | |
| library(dplyr) | |
| library(ggplot2) | |
| # 1. Sitting Justices as of 2026 | |
| keep <- c("CThomas", "SAAlito", "JGRoberts", "EKagan", "SSotomayor", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from io import StringIO | |
| import matplotlib.pyplot as plt | |
| import matplotlib.dates as mdates | |
| csv_data = """Product,Start Date,End Date,Notes,Color | |
| Bread (Wheat Flour),2024-01-01,2024-12-31,Grain can be stored year-round,#C2A14D | |
| Bacon (Cured Pork),2024-01-01,2024-12-31,Pigs slaughtered in winter and meat cured for year-round storage,#C45A4A | |
| Turkey,2024-11-01,2025-01-31,Traditional seasonal consumption around holidays,#E8D2C5 | |
| Lettuce,2024-05-15,2024-09-30,Cool-season crop; short shelf life before modern cooling,#4CAF50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #get all ember energy data | |
| import pandas as pd | |
| df = pd.read_csv("https://storage.googleapis.com/emb-prod-bkt-publicdata/public-downloads/monthly_full_release_long_format.csv",low_memory=False) | |
| #get coal usage | |
| import pandas as pd | |
| df_china_coal_twh = df[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Phase of Flight,Number of Accidents | |
| LANDING,788 | |
| TAKE OFF,128 | |
| APPROACH,124 | |
| INITIAL CLIMB,92 | |
| CRUISE,70 | |
| TAXI IN,49 | |
| TAXI OUT,45 | |
| ENGINE START OR DEPART,44 | |
| GO AROUND,29 |
NewerOlder