Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ValueError in dump_bin.py by excluding 'symbol' field from conversion #1865

Closed

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