# Reproduce the September 2026 research

These scripts use Python 3's standard library and the downloadable JSON files.
They make no model calls and do not require an account. A dataset's JSON
metadata states its coverage, date fields, limits and input provenance.

## Weibo title recurrence

Download `attention-2026-09-07.json` from the same directory as this file.
The export contains 1,700 original-title observations. `observed_at` is
collection time in Beijing; source publication time is unavailable.

Normalization removes the collector's initial rank number and final bracketed
badge. It does not merge aliases, whitespace differences inside a title,
synonyms or related stories. The source file is retained at Git revision
`bc8929f0908b7aa54099641290efa825af9aa417`. Access to the repository is not
required to reproduce the calculations from this public export.

```python
import collections
import json
import re

with open("attention-2026-09-07.json", encoding="utf-8") as f:
    rows = json.load(f)["rows"]

topics = collections.defaultdict(set)
for row in rows:
    topic = re.sub(r"^\d+\.\s*", "", row["title_original"])
    topic = re.sub(r"\s*\[[^\]]+\]$", "", topic).strip()
    assert topic == row["topic_normalized"]
    topics[topic].add(row["observed_at"])

once = sum(len(observed) == 1 for observed in topics.values())
print("Snapshots:", len({r["observed_at"] for r in rows}))
print("Observations:", len(rows))
print("Titles:", len(topics))
print("One-snapshot titles:", once)
print("One-snapshot share:", round(100 * once / len(topics), 1))
print("Recurrence:", dict(sorted(collections.Counter(map(len, topics.values())).items())))
iphone = [r for r in rows if "iphone" in r["topic_normalized"].lower()]
print("iPhone observations:", len(iphone))
print("iPhone titles:", len({r["topic_normalized"] for r in iphone}))
print("iPhone snapshots:", len({r["observed_at"] for r in iphone}))
```

Expected output: 34 snapshots, 1,700 observations, 1,410 titles, 1,169 titles
in one snapshot, 82.9 percent. The iPhone query yields 94 observations,
65 titles and 24 snapshots. The missing scheduled collection is 12 September
2026 at 18:30 Beijing time. It is not imputed.

The collection schedule is 06:00, 10:30, 14:00, 18:30 and 22:00. Actual collection
timestamps can run a few minutes later. The 7–13 September window is a sample
of top-50 boards, not continuous coverage of all Weibo activity. Source URLs
open current topic searches, not archived posts. Heat, reach, demographic and
sentiment estimates are outside this extract.

## Four-city housing comparison

Download `housing-two-markets.json`. Its 24 rows contain four named cities,
two housing markets and three reference months. Each row preserves the original
month-on-month and year-on-year indices as well as derived percentage changes.

```python
import collections
import json

with open("housing-two-markets.json", encoding="utf-8") as f:
    rows = json.load(f)["rows"]

pairs = collections.defaultdict(dict)
for row in rows:
    yoy = round(row["yoy_index"] - 100, 1)
    assert yoy == row["yoy_percent"]
    assert round(row["mom_index"] - 100, 1) == row["mom_percent"]
    pairs[(row["period"], row["city"])][row["market"]] = yoy

for (period, city), values in sorted(pairs.items()):
    assert set(values) == {"new", "resale"}
    gap = round(values["new"] - values["resale"], 1)
    print(period, city, "new", values["new"], "resale", values["resale"], "gap_pp", gap)
```

The year-on-year indices use the same month a year earlier = 100. The displayed
percentage change is the index minus 100. The difference between new and resale
changes is a gap in growth rates in percentage points, not a price-level premium.

Source tables I and II were read directly from the National Bureau of Statistics:

- [May 2026](https://www.stats.gov.cn/english/PressRelease/202606/t20260616_1963956.html), released 16 June 2026.
- [June 2026](https://www.stats.gov.cn/english/PressRelease/202607/t20260716_1964150.html), released 16 July 2026.
- [July 2026](https://www.stats.gov.cn/english/PressRelease/202608/t20260817_1965061.html), released 17 August 2026.

The extract selects Beijing, Shanghai, Guangzhou and Shenzhen from each of the
first two tables. `period` is the reference month, `published_date` is the
release date and `retrieved_date` is 14 September 2026. Original fetched HTML
hashes are in the JSON metadata. No full source text is republished.

## Preparation and review

The articles and these instructions were prepared with AI assistance. Human
editorial review has not been recorded. The research pages contain no ad units.
Corrections should identify the affected field or sentence and provide the
supporting source through [Contact](https://china-snapshot.com/contact).
