Skip to content

Conversation

@Nathan-Bransby-NMT
Copy link

Fixes #1852

Modify scripts/dump_bin.py to handle the conversion of string 'SH600000' to float correctly.

  • Exclude 'symbol' field from conversion:

    • Modify _data_to_bin method to exclude the 'symbol' field from conversion to float.
    • Add a check to ensure 'symbol' field is not included in the fields to be converted.
  • Update normalize_data method:

    • Ensure normalize_data method in scripts/data_collector/baostock_5min/collector.py processes data correctly without converting 'symbol' to float.
    • Update normalize_baostock method to retain 'symbol' field as a string.
  • Documentation update:

    • Emphasize the importance of normalize_data before using dump_bin.py in scripts/data_collector/baostock_5min/README.md.

…sion

Fixes microsoft#1852

Modify `scripts/dump_bin.py` to handle the conversion of string 'SH600000' to float correctly.

* **Exclude 'symbol' field from conversion**:
  - Modify `_data_to_bin` method to exclude the 'symbol' field from conversion to float.
  - Add a check to ensure 'symbol' field is not included in the fields to be converted.

* **Update `normalize_data` method**:
  - Ensure `normalize_data` method in `scripts/data_collector/baostock_5min/collector.py` processes data correctly without converting 'symbol' to float.
  - Update `normalize_baostock` method to retain 'symbol' field as a string.

* **Documentation update**:
  - Emphasize the importance of `normalize_data` before using `dump_bin.py` in `scripts/data_collector/baostock_5min/README.md`.
@github-actions github-actions bot added documentation Improvements or additions to documentation waiting for triage Cannot auto-triage, wait for triage. labels Dec 3, 2024
@Nathan-Bransby-NMT
Copy link
Author

@microsoft-github-policy-service agree

@SunsetWolf
Copy link
Collaborator

We would like to understand what the purpose of this change is, I understand that if the data is normalized before dump_bin, the symbol field will not appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation waiting for triage Cannot auto-triage, wait for triage.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: could not convert string to float: 'SH600000' when i use dump_bin.py

2 participants