`Microsimulation.df` throws `TypeError` with some sequences of variables
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start in openfisca_tools/microsimulation.py at map_to, using the two variable-order examples in the issue to reproduce the TypeError. Confirm that both sequences return a dataframe successfully and add regression coverage for the household string and spmu float combination.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This works:
from openfisca_us import Microsimulation
sim = Microsimulation()
sim.df(["state_code", "snap_gross_income_fpg_ratio"])
but this doesn't:
sim.df(["snap_gross_income_fpg_ratio", "state_code"])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-11-856cb2e0dc06>](https://localhost:8080/#) in <module>()
----> 1 df = sim.df(["snap_gross_income_fpg_ratio", "state_code"])
2 ca_below_fpl = df[(df.snap_gross_income_fpg_ratio < 1) & (df.state_code == "CA")]
3 ca_below_fpl
3 frames
[/usr/local/lib/python3.7/dist-packages/openfisca_tools/microsimulation.py](https://localhost:8080/#) in map_to(self, arr, entity, target_entity, how)
216 return entity_pop.project(arr)
217 if how == "mean":
--> 218 return entity_pop.project(arr / entity_pop.nb_persons())
219 elif entity == target_entity:
220 return arr
TypeError: ufunc 'true_divide' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
state_code is a household-level string, snap_gross_income_fpg_ratio is a spmu-level float.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 1
- Merge trung bình
- 11 giờ 16 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/openfisca-tools
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
-
Partial formula executionĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
PolicyEngine/openfisca-tools#65 · 4 bình luận ·
Tất cả issue của PolicyEngine/openfisca-tools
Issue tương tự
-
bot-triaged module: LrScheduler module: optimizer triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation glm5 llm-model
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/vllm-ascend#19062 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Author Page: shuai-zhao-llmĐang mởauthor-page correction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
acl-org/acl-anthology#10496 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Issue Type: Bug Report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
celery/celery#10875 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
SasanLabs/VulnerableApp#836 ·
Maintainer thường phản hồi trong vòng 1 ngày