Python Forum
What is the mechanism of numpy function returning pandas object?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the mechanism of numpy function returning pandas object?
#1
Numpy's isnan() can generate the result as Series class of pandas, although numpy does not have dependency on pandas and Numpy's API reference does not explain this as below. Could anyone please tell me the mechanism of this? Unfortunately, I could not find isnan()'s definition in Numpy's source codes.

isnan()'s API Reference Wrote:Returns: y : ndarray or bool
True where x is NaN, false otherwise. This is a scalar if x is a scalar.

Example
s = pd.Series([0])
print(type(np.isnan(s)))
Output:
<class 'pandas.core.series.Series'>
Reply


Messages In This Thread
What is the mechanism of numpy function returning pandas object? - by Ibaraki - Apr-04-2020, 03:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 638 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Help to control pandas.melt function vanphuht91 0 718 Jun-17-2023, 08:41 AM
Last Post: vanphuht91
  Pandas dataframes and numpy arrays bytecrunch 1 1,342 Oct-11-2022, 08:08 PM
Last Post: Larz60+
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,643 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  Pandas replace function not working on datafram with floats bcrypto 1 2,913 Apr-12-2021, 08:59 PM
Last Post: bcrypto
  numpy.ndarray' object is not callable natareid 4 3,878 Oct-16-2020, 08:00 AM
Last Post: sanrock123
  How to compare two json and write to third json differences with pandas and numpy onenessboy 0 4,727 Jul-24-2020, 01:56 PM
Last Post: onenessboy
  'numpy.ndarray' object is not callable ato_cr 1 15,273 May-12-2020, 08:12 AM
Last Post: anbu23
  numpy.float64 object is not iterable jcdr91 1 13,253 Apr-22-2020, 04:09 PM
Last Post: jefsummers
  how to apply user defined function to Pandas DataFrame evelynow 3 7,664 Aug-20-2019, 11:35 PM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020