How to check module where a function come from?Calling a function of a module by using its name (a string)How do I check if a list is empty?How do I check whether a file exists without exceptions?How to flush output of print function?How to randomly select an item from a list?How do I check if a string is a number (float)?How to make a chain of function decorators?Reloading submodules in IPythonipython reads wrong python version“Large data” work flows using pandas
Using Newton's shell theorem to accelerate a spaceship
Terry Pratchett book with a lawyer dragon and sheep
How can I effectively communicate to recruiters that a phone call is not possible?
QGIS Zanzibar how to crop?
How do you glue a text to a point?
Why are they 'nude photos'?
How to loop for 3 times in bash script when docker push fails?
Would dual wielding daggers be a viable choice for a covert bodyguard?
Why are Hobbits so fond of mushrooms?
Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?
Combining latex input and sed
What is this triple-transistor arrangement called?
Are randomly-generated passwords starting with "a" less secure?
Why cant i get partition elimination when partition column values are in a lookup table?
How many hours would it take to watch all of Doctor Who?
RPI3B+: What are the four components below the HDMI connector called?
What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?
How to properly say "bail on somebody" in German?
Is a request to book a business flight ticket for a graduate student an unreasonable one?
Is the genetic term "polycistronic" still used in modern biology?
Misspelling my name on my mathematical publications
Why isn't there research to build a standard lunar, or Martian mobility platform?
Cops: The Hidden OEIS Substring
Graduate student with abysmal English writing skills, how to help
How to check module where a function come from?
Calling a function of a module by using its name (a string)How do I check if a list is empty?How do I check whether a file exists without exceptions?How to flush output of print function?How to randomly select an item from a list?How do I check if a string is a number (float)?How to make a chain of function decorators?Reloading submodules in IPythonipython reads wrong python version“Large data” work flows using pandas
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am running script in the Spyder IPython console as below:
In [12]: mydf['logintimes'].count()
Out[12]: 40
As I import several modules:
import numpy
import pandas
import matplotlib
import scipy.stats
Is count()
a python function, pandas function or numpy
function?
I tried Ctrl+I in Spyder, but no documentation was available.
python python-3.x
add a comment |
I am running script in the Spyder IPython console as below:
In [12]: mydf['logintimes'].count()
Out[12]: 40
As I import several modules:
import numpy
import pandas
import matplotlib
import scipy.stats
Is count()
a python function, pandas function or numpy
function?
I tried Ctrl+I in Spyder, but no documentation was available.
python python-3.x
add a comment |
I am running script in the Spyder IPython console as below:
In [12]: mydf['logintimes'].count()
Out[12]: 40
As I import several modules:
import numpy
import pandas
import matplotlib
import scipy.stats
Is count()
a python function, pandas function or numpy
function?
I tried Ctrl+I in Spyder, but no documentation was available.
python python-3.x
I am running script in the Spyder IPython console as below:
In [12]: mydf['logintimes'].count()
Out[12]: 40
As I import several modules:
import numpy
import pandas
import matplotlib
import scipy.stats
Is count()
a python function, pandas function or numpy
function?
I tried Ctrl+I in Spyder, but no documentation was available.
python python-3.x
python python-3.x
edited Mar 26 at 3:59


Pikachu the Parenthesis Wizard
2,1688 gold badges17 silver badges29 bronze badges
2,1688 gold badges17 silver badges29 bronze badges
asked Mar 26 at 2:31


kittygirlkittygirl
6021 gold badge6 silver badges18 bronze badges
6021 gold badge6 silver badges18 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
U9-Forward is correct, you should normally know it.
However, thanks to python's introspection features, you can also retrieve that information from the objects themselves:
>>> s = pandas.Series([1, 2, 3, 4, 5])
>>> s.count.__qualname__
'Series.count'
>>> s.count.__module__
'pandas.core.series'
Or for built-in list object, note the lack of __module__
.
>>> l = [1, 2, 3, 4, 5]
>>> l.count.__qualname__
'list.count'
>>> l.count.__module__
add a comment |
You have to know it, it is a python function and also a pandas function, you can see it by this:
>>> l = [1, 2, 3, 3]
>>> l.count(3) # python function
2
And a pandas function:
>>> s = pd.Series([1, 2, 3, 3])
>>> s.count()
4
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349027%2fhow-to-check-module-where-a-function-come-from%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
U9-Forward is correct, you should normally know it.
However, thanks to python's introspection features, you can also retrieve that information from the objects themselves:
>>> s = pandas.Series([1, 2, 3, 4, 5])
>>> s.count.__qualname__
'Series.count'
>>> s.count.__module__
'pandas.core.series'
Or for built-in list object, note the lack of __module__
.
>>> l = [1, 2, 3, 4, 5]
>>> l.count.__qualname__
'list.count'
>>> l.count.__module__
add a comment |
U9-Forward is correct, you should normally know it.
However, thanks to python's introspection features, you can also retrieve that information from the objects themselves:
>>> s = pandas.Series([1, 2, 3, 4, 5])
>>> s.count.__qualname__
'Series.count'
>>> s.count.__module__
'pandas.core.series'
Or for built-in list object, note the lack of __module__
.
>>> l = [1, 2, 3, 4, 5]
>>> l.count.__qualname__
'list.count'
>>> l.count.__module__
add a comment |
U9-Forward is correct, you should normally know it.
However, thanks to python's introspection features, you can also retrieve that information from the objects themselves:
>>> s = pandas.Series([1, 2, 3, 4, 5])
>>> s.count.__qualname__
'Series.count'
>>> s.count.__module__
'pandas.core.series'
Or for built-in list object, note the lack of __module__
.
>>> l = [1, 2, 3, 4, 5]
>>> l.count.__qualname__
'list.count'
>>> l.count.__module__
U9-Forward is correct, you should normally know it.
However, thanks to python's introspection features, you can also retrieve that information from the objects themselves:
>>> s = pandas.Series([1, 2, 3, 4, 5])
>>> s.count.__qualname__
'Series.count'
>>> s.count.__module__
'pandas.core.series'
Or for built-in list object, note the lack of __module__
.
>>> l = [1, 2, 3, 4, 5]
>>> l.count.__qualname__
'list.count'
>>> l.count.__module__
answered Mar 26 at 2:45


spectrasspectras
8,1911 gold badge17 silver badges35 bronze badges
8,1911 gold badge17 silver badges35 bronze badges
add a comment |
add a comment |
You have to know it, it is a python function and also a pandas function, you can see it by this:
>>> l = [1, 2, 3, 3]
>>> l.count(3) # python function
2
And a pandas function:
>>> s = pd.Series([1, 2, 3, 3])
>>> s.count()
4
add a comment |
You have to know it, it is a python function and also a pandas function, you can see it by this:
>>> l = [1, 2, 3, 3]
>>> l.count(3) # python function
2
And a pandas function:
>>> s = pd.Series([1, 2, 3, 3])
>>> s.count()
4
add a comment |
You have to know it, it is a python function and also a pandas function, you can see it by this:
>>> l = [1, 2, 3, 3]
>>> l.count(3) # python function
2
And a pandas function:
>>> s = pd.Series([1, 2, 3, 3])
>>> s.count()
4
You have to know it, it is a python function and also a pandas function, you can see it by this:
>>> l = [1, 2, 3, 3]
>>> l.count(3) # python function
2
And a pandas function:
>>> s = pd.Series([1, 2, 3, 3])
>>> s.count()
4
answered Mar 26 at 2:36


U10-ForwardU10-Forward
24.4k5 gold badges19 silver badges47 bronze badges
24.4k5 gold badges19 silver badges47 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349027%2fhow-to-check-module-where-a-function-come-from%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown