You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "dgd_contributor (Jira)" <ji...@apache.org> on 2021/09/06 02:53:00 UTC

[jira] [Updated] (SPARK-36671) Support __and__ in num_ops.py

     [ https://issues.apache.org/jira/browse/SPARK-36671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

dgd_contributor updated SPARK-36671:
------------------------------------
    Description: 
{code:python}
>>> pser1 = pd.Series([1, 2, 3])
>>> pser2 = pd.Series([4, 5, 6, 7])
>>> pser1 & pser2
0    False
1    False
2     True
3    False
dtype: bool

>>> pser1 = ps.Series([1, 2, 3])
>>> pser2 = ps.Series([4, 5, 6, 7])
>>> pser1 & pser2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dgd/spark/python/pyspark/pandas/base.py", line 423, in __and__
    return self._dtype_op.__and__(self, other)
  File "/Users/dgd/spark/python/pyspark/pandas/data_type_ops/base.py", line 317, in __and__
    raise TypeError("Bitwise and can not be applied to %s." % self.pretty_name)
TypeError: Bitwise and can not be applied to integrals.

{code}
 

  was:
{code:python}
>>> pser1 = pd.Series([1, 2, 3])
>>> pser2 = pd.Series([4, 5, 6, 7])
>>> pser1 ^ pser2
0     True
1     True
2     True
3    False
dtype: bool

>>> pser1 = ps.Series([1, 2, 3])
>>> pser2 = ps.Series([4, 5, 6, 7])
>>> pser1 & pser2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dgd/spark/python/pyspark/pandas/base.py", line 423, in __and__
    return self._dtype_op.__and__(self, other)
  File "/Users/dgd/spark/python/pyspark/pandas/data_type_ops/base.py", line 317, in __and__
    raise TypeError("Bitwise and can not be applied to %s." % self.pretty_name)
TypeError: Bitwise and can not be applied to integrals.

{code}
 


> Support __and__ in num_ops.py
> -----------------------------
>
>                 Key: SPARK-36671
>                 URL: https://issues.apache.org/jira/browse/SPARK-36671
>             Project: Spark
>          Issue Type: Sub-task
>          Components: PySpark
>    Affects Versions: 3.3.0
>            Reporter: dgd_contributor
>            Priority: Major
>
> {code:python}
> >>> pser1 = pd.Series([1, 2, 3])
> >>> pser2 = pd.Series([4, 5, 6, 7])
> >>> pser1 & pser2
> 0    False
> 1    False
> 2     True
> 3    False
> dtype: bool
> >>> pser1 = ps.Series([1, 2, 3])
> >>> pser2 = ps.Series([4, 5, 6, 7])
> >>> pser1 & pser2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/Users/dgd/spark/python/pyspark/pandas/base.py", line 423, in __and__
>     return self._dtype_op.__and__(self, other)
>   File "/Users/dgd/spark/python/pyspark/pandas/data_type_ops/base.py", line 317, in __and__
>     raise TypeError("Bitwise and can not be applied to %s." % self.pretty_name)
> TypeError: Bitwise and can not be applied to integrals.
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org