<jupyter_start><jupyter_text>运行<jupyter_code>from zipline.pipeline import Pipeline, STOCK_DB, Fundamentals

from zipline.pipeline.data import USEquityPricing
from zipline.pipeline.filters import StaticSids
from zipline.research.run import run_pipeline
from zipline.pipeline.builtin import MarketCap
def make_pipeline():
    cap = MarketCap(window_length=1)
    return Pipeline(
        columns = {
            '流通市值':cap,
            '收盘价':USEquityPricing.close.latest,
            '流通股本':cap / USEquityPricing.close.latest,
        },
        screen = StaticSids([1,2])
    )
df = run_pipeline(make_pipeline(), '2017-11-29','2017-11-30')
df<jupyter_output><empty_output><jupyter_text>验证<jupyter_code>int(df['流通股本'][0] / 10000) == int(df['流通股本'][2] / 10000)
int(df['流通股本'][1] / 10000) == int(df['流通股本'][3] / 10000)
# 平安银行
# 以亿股为单位验证
assert round(df['流通股本'][0] / 10000 / 10000, 0) == round(1691798.97 / 10000,0)
# 万 科Ａ
# 以亿股为单位验证
assert round(df['流通股本'][1] / 10000 / 10000, 0) == round(970916.51 / 10000,0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15458937198067632, 'fraction_numerical': 0.0927536231884058, 'mean_word_length': 4.34020618556701, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '446789', 'license': 'Apache-2.0', 'n_tokens_mistral': 510, 'n_tokens_neox': 458, 'n_words': 65, 'path': 'docs/memo/pipeline/Factors/test_market_cap.ipynb', 'repo_name': 'zhangshoug/czipline', 'size': '1035'}