Skip to content

scipy.stats.norm.pdf isn't usable from PyCall #87

Closed

Description

@mrkn

In ruby:

>> PyCall.import_module('scipy.stats').norm.pdf([1, 2, 3], 0, 10)
PyCall::PyError: <class 'TypeError'>: pdf() takes 2 positional arguments but 4 were given
from /Users/mrkn/src/github.com/mrkn/pycall.rb/lib/pycall/pyobject_wrapper.rb:43:in `pdf'

In python:

>>> import scipy.stats
>>> scipy.stats.norm.pdf([1, 2, 3], 0, 10)
array([0.03969525, 0.03910427, 0.03813878])

Activity

  1. zamananjum0 commented on Dec 28, 2022

    @zamananjum0

    any update on this??

  2. mrkn commented on Dec 28, 2022

    @mrkn
    MemberAuthor

    No, there isn't any updates. I’m sorry I cannot handle this right now. Any investigation results you may have are welcome.

  3. felixmarch commented on Nov 10, 2026

    @felixmarch
    Contributor

    The issue is reproducible

    Image

    (my env is windows with anaconda)

    On python, the same codes work fine there:

    Image
  4. felixmarch commented on Nov 10, 2026

    @felixmarch
    Contributor

    PR #238 raised

    > bundle exec irb -Iext/pycall
    
    irb(main):001> require "pycall"
    => true
    irb(main):002> stats = PyCall.import_module("scipy.stats")
    => <module 'scipy.stats' from 'C:\\ProgramData\\anaconda3\\Lib\\site-packages\\scipy\\stats\\__init__.py'>
    irb(main):003> stats.norm.pdf([1, 2, 3], 0, 10)
    => array([0.03969525, 0.03910427, 0.03813878])
    irb(main):004>
    
  5. added a commit that references this issue on Nov 12, 2026
    4f288e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions