pandas 1.4.2

import pandas as pd

from pandas._libs.arrays import NDArrayBacked as cls

dti = pd.date_range("2016-01-01", periods=3) dta = dti._data arr = dta._ndarray

obj = cls._simple_new(arr, arr.dtype)

# for foo in [arr, dta, obj]: ...

%timeit foo.copy() 299 ns ± 30 ns per loop # <-- arr underlying ndarray (for reference) 530 ns ± 9.24 ns per loop # <-- dta with cython NDArrayBacked 1.66 µs ± 46.3 ns per loop # <-- dta without cython NDArrayBacked 328 ns ± 5.29 ns per loop # <-- obj with NDArrayBacked.__cinit__ 371 ns ± 6.97 ns per loop # <-- obj with NDArrayBacked._simple_new

%timeit foo.T 125 ns ± 6.27 ns per loop # <-- arr underlying ndarray (for reference) 226 ns ± 7.66 ns per loop # <-- dta with cython NDArrayBacked 911 ns ± 16.6 ns per loop # <-- dta without cython NDArrayBacked 215 ns ± 4.54 ns per loop # <-- obj with NDArrayBacked._simple_new

Implementing these methods in cython improves performance quite a bit.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/_libs/arrays.cpython-39-darwin.so#None
type: <class 'type'>
Commit: