Pometry / Pometry/Raphtory

Materializing Views documentation example fails on PageRank and/or "to_df()" call???

Open Beginner friendly
#2,714 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
642
Forks
70
Avg merge
2d 13h
Merged PRs (30d)
21

Description

In the docs for the Raphtory, Graph Views > Materializing Views, there is this example given that fails to run as I try to learn the usage graph analysis
--o

import raphtory.algorithms as algo

grooming_week1 = g.layers(["Grooming"]).window("2019-06-17", "2019-06-24")
print(f"Grooming week 1: {grooming_week1.count_temporal_edges()} edge updates")

cached = grooming_week1.cache_view()

pr = algo.pagerank(cached)
top_baboons = pr.to_df().sort_values("value", ascending=False).head(5)
print(f"\nTop 5 baboons by PageRank in grooming network:")
print(top_baboons.to_string(index=False))

--o

Apparently the error is thrown at "top_baboons = pr.to_df().sort_values("value", ascending=False).head(5)", stating (in VS Code)... AttributeError: 'raphtory.output_node_state.OutputNodeState' object has no attribute 'to_df'

Not sure if this is an oversight or a bug somewhere, thanks in advance for any help in clarifying / resolving.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Graph Views > Materializing Views documentation example and run the PageRank snippet, focusing on the failing pr.to_df() call. Check the returned OutputNodeState API and related examples to determine the supported conversion. Done means the documented example runs successfully and produces the top five results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.