1

按照安装指南,我安装了atoti库:

(atoti) C:\Users>conda list
# packages in environment at C:\Apps\miniconda3\envs\atoti:
#
# Name                    Version                   Build  Channel
abseil-cpp                20200225.2           ha925a31_2    conda-forge
aplus                     0.11.0                   pypi_0    pypi
appdirs                   1.4.3                      py_1    conda-forge
argon2-cffi               20.1.0           py38h1e8a9f7_1    conda-forge
arrow-cpp                 1.0.1           py38h1234567_1_cpu    conda-forge
astropy                   4.0.1.post1              pypi_0    pypi
atoti                     0.4.3                   9238575    https://conda.atoti.io
attrs                     20.1.0             pyh9f0ad1d_0    conda-forge
...

我还从 atoti 的 github 下载了Pnl Explained notebook,我正在尝试读取 s3 上的文件:

position_sensitivity_store = session.read_csv(
    "https://data.atoti.io/notebooks/pnl-explained/position_sensitivities.csv",
    keys=["book_id", "instrument_code", "currency", "curve", "tenor"],
    store_name="Position Sensitivities Store",
)

我遇到了以下异常:

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'https:\\data.atoti.io\\notebooks\\pnl-explained\\position_sensitivities.csv'

我可以直接从浏览器访问该文件。如何将源文件加载到atoti?我需要额外的库来读取 S3 上的源文件吗?

4

1 回答 1

1

加载S3数据需要使用scheme s3,如新版notebook所示:

position_sensitivity_store = session.read_csv(
    "s3://data.atoti.io/notebooks/pnl-explained/position_sensitivities.csv",
    keys=["book_id", "instrument_code", "currency", "curve", "tenor"],
    store_name="Position Sensitivities Store",
)

请参阅此页面 [1] 以获取完整参考。

因为您指向笔记本提供的数据,所以笔记本被移动 - 根据链接末尾的新文档 - 我怀疑它使用的数据也被移动到其他地方。顺便说一句,它现在在这里 [2]。

[1] https://docs.atoti.io/0.4.3/data-access.html# [2] https://github.com/atoti/notebooks/blob/master/notebooks/pnl-explained/main。 ipynb

于 2020-11-06T14:40:49.143 回答