stream_graph.LinkSetDF

class stream_graph.LinkSetDF(df=None, no_duplicates=True, sort_by=None, weighted=False, merge_function=None, operation_functions=None)[source][source]

DataFrame implementation of the ABC.LinkSet

Parameters
df: pandas.DataFrame or Iterable, default=None

If a DataFrame it should contain two columns for u and v. If an Iterable it should produce (u, v) tuples of NodeId (int or str).

no_duplicates: Bool, default=False

Defines if the input could contain duplicate tuples.

sort_by: A non-empty subset of [‘u’, ‘v’], default=[‘u’, ‘v’]

The order of the DataFrame elements by which they will be produced when iterated.

Attributes
as_graph

Generate the graph containing this LinkSet.

df
is_sorted_
merge_
nodeset

Return the nodeset that can be derived from the LinkSet.

reindex_
size

Returns the size of the LinkSet.

sort_
sort_by
to_unweighted

Return an unweighted version of this LinkSetDF.

to_weighted

Return an weighted version of this LinkSetDF.

weighted

Defines if the object is weighted.

weighted_size

Returns the weighted size of the LinkSet.

Methods

copy(self[, deep])

Returns a deep or shallow copy of the current LinkSet.

degree(self[, u, direction, weights])

Return the degree of a node.

issuperset(self, ls)

neighbors_of(self[, u, direction])

__class__[source]

alias of abc.ABCMeta

__delattr__(self, name, /)

Implement delattr(self, name).

__dir__()

default dir() implementation

__eq__(self, obj)[source][source]

Compare equality in the level of data.

__format__()

default object formatter

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__()

size of object in memory, in bytes

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

property as_graph

Generate the graph containing this LinkSet.

Parameters
None. Property.
Returns
graphGraph

Generates a Graph containing the LinkSet.

copy(self, deep=True)[source]

Returns a deep or shallow copy of the current LinkSet.

Parameters
deepBool
Returns
linkset_copyLinkSet

Returns a deep or shallow copy of the current LinkSet

degree(self, u=None, direction='out', weights=False)[source]

Return the degree of a node.

Parameters
uNode_Id, default=None

direction : string={‘in’, ‘out’, ‘both’}, default=’both’

weights : bool, default=False

Returns
nodestreamReal or NodeCollection(Real)

Return the (‘in’, ‘out’ or ‘both’) degree of a node of u. If None returns a NodeCollection with the degree for each Node.

.
property to_unweighted

Return an unweighted version of this LinkSetDF.

property to_weighted

Return an weighted version of this LinkSetDF.

property weighted

Defines if the object is weighted.

property weighted_size

Returns the weighted size of the LinkSet.

Parameters
None. Property.
Returns
sizeReal

The sum of weights of links.