How does one learns anything new? Remember the time when you learned to write, the time you learned to cycle, the time you learned to operate a computer etc. All of these learning have one thing in common: the ability of humans to recognize patterns.

Now coming to this specific question, first of all, a basic understanding of what the library does is important for diving deep into it.

Over the years I can sum up the way to learn python library into three steps:

help(library): The help method is a built-in python help system. It works in interactive mode. So, while developing python programs, fire up a python shell in a terminal and use help() method to get help on modules, functions or any python object.
For example, suppose you want to learn numpy(used for fast array computations) library Just type help(numpy) in python shell to get documentation on it.

An snippet of help on numpy package.

help(numpy)

Stackoverflow: Stackoverflow have tons of question and answers regarding python. It comes to rescue when examples and docstring from help() method is not sufficient or available. Ask for help about specific usecase like function parameters etc.
For example:

https://stackoverflow.com/questi…

Read Code: Last but the most used by great developers over the decades. Now to use it , one needs to know the file path in which specific class, method or module is written in.
Use python built-in inspect module to get the file path in an interactive shell first.

Important: This only works for modules or objects which are not built-in .

import inspect

replace ‘name’ by appropriate method, module or class name

inspect.getmodule(name).__file__

Once you have the file path , use any editor to open file and start reading the relevant lines.

https://www.quora.com/How-do-I-learn-a-python-library#