Merging a dask dataframe with a pandas series fails
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
Reproduce df.merge(df.name.head()) from the issue, then inspect the merge entry point in dask_expr/_collection.py around line 4783. Done means merging the Dask dataframe with the pandas Series no longer raises AttributeError and produces behavior consistent with the shown pandas result.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In [1]: import dask
In [2]: import dask_expr as dd
...: df = dd.datasets.timeseries()
In [3]: df.head()
Out[3]:
name id x y
timestamp
2000-01-01 00:00:00 Michael 1006 0.927520 -0.442859
2000-01-01 00:00:01 Kevin 1018 -0.411144 -0.037667
2000-01-01 00:00:02 Yvonne 974 -0.648850 -0.515754
2000-01-01 00:00:03 Yvonne 994 0.463103 0.560937
2000-01-01 00:00:04 Yvonne 1002 -0.511311 -0.308211
In [4]: df.merge(df.name.head())
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-254398e6f615> in ?()
----> 1 df.merge(df.name.head())
~/workspace/dask-expr/dask_expr/_collection.py in ?(self, right, how, on, left_on, right_on, left_index, right_index, suffixes, indicator, shuffle_method, npartitions, broadcast)
2572 an internal ``shuffle``, because shuffling places all rows that have the same
2573 index in the same partition. To avoid this error, make sure all rows with the
2574 same ``on``-column value can fit on a single partition.
2575 """
-> 2576 return merge(
2577 self,
2578 right,
2579 how,
~/workspace/dask-expr/dask_expr/_collection.py in ?(left, right, how, on, left_on, right_on, left_index, right_index, suffixes, indicator, shuffle_method, npartitions, broadcast)
4779 for o in [on, left_on, right_on]:
4780 if isinstance(o, FrameBase):
4781 raise NotImplementedError()
4782 if not on and not left_on and not right_on and not left_index and not right_index:
-> 4783 on = [c for c in left.columns if c in right.columns]
4784 if not on:
4785 left_index = right_index = True
4786
~/workspace/dask-expr/dask_expr/_collection.py in ?(.0)
-> 4783 def merge(
4784 left,
4785 right,
4786 how="inner",
~/mambaforge/envs/etl-tpch/lib/python3.11/site-packages/pandas/core/generic.py in ?(self, name)
6289 and name not in self._accessors
6290 and self._info_axis._can_hold_identifiers_and_holds_name(name)
6291 ):
6292 return self[name]
-> 6293 return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'columns'
In [5]: df.head().merge(df.name.head())
Out[5]:
name id x y
0 Michael 1006 0.927520 -0.442859
1 Kevin 1018 -0.411144 -0.037667
2 Yvonne 974 -0.648850 -0.515754
3 Yvonne 974 -0.648850 -0.515754
4 Yvonne 974 -0.648850 -0.515754
5 Yvonne 994 0.463103 0.560937
6 Yvonne 994 0.463103 0.560937
7 Yvonne 994 0.463103 0.560937
8 Yvonne 1002 -0.511311 -0.308211
9 Yvonne 1002 -0.511311 -0.308211
10 Yvonne 1002 -0.511311 -0.308211
- Ngôn ngữ chính
- Python
- Star
- 89
- Fork
- 26
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 dask/dask-expr
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Predicate pull-up optimizationĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Tất cả issue của dask/dask-expr
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zach-blumenfeld/aip#13 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
nathanmarlor/foxess_modbus#1287 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
OpenLakeForge/openlakeforge#498 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest help wanted python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Exact onnxruntime==1.27.0 core pin makes Pipecat-based apps uninstallable from the dashboardĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
pollen-robotics/reachy_mini#1493 ·
Maintainer thường phản hồi trong vòng 1 ngày