Comments (5)
@amedury there's a bug in networkx 2.1. To calculate centrality on a line graph, use either nx 2.0 or the unreleased release candidate of 2.2. Will be formally resolved whenever nx 2.2 is released. See also #6
from osmnx-examples.
I'm running 2.2 and I am getting the error code NetworkXNotImplemented: not implemented for undirected type when I attempt to run centrality on a directed graph I generated from the from_pandas_edgelist function.
from osmnx-examples.
What is the type(G)
of the graph G you're passing in to the line_graph function?
from osmnx-examples.
networkx.classes.graph.Graph
I generated it from
def picturefeeder(text,function):
keywords = []
sentences = [x + '.' for x in text.replace('?','.').replace('!','.').split('.')]
for n in [*range(0,len(sentences)-1)]:
# Build your graph
G=nx.from_pandas_edgelist(spacyfunction(sentences[n]),source='textnum',target='parentnum')
comm = pd.DataFrame(function(G))
centraldata = pd.merge(pd.DataFrame(comm.mean()),spacyfunction(sentences[n]), left_index=True,right_on='textnum')
bestnoun = centraldata[centraldata['pos'].isin(['NOUN','PRON'])].sort_values(0,ascending=False).head(1)
#keywords.append([*bestnoun['text']])
#keywordsa.append([*bestnoun['textnum']])
childnodes = centraldata[centraldata['parentnum'] == [*bestnoun['textnum']][0]]
childnodes = childnodes[childnodes['pos'] != 'PUNCT'][childnodes['pos'] != 'ADP']
feeder = pd.concat([childnodes,bestnoun])
#keywords.append([[*bestnoun['text']],[*centraldata[centraldata['parentnum'] == [*bestnoun['textnum']][0]]['text']]])
keywords.append(' '.join([*feeder.sort_index()['text']]))
keywords = [x.strip() for x in keywords]
return keywords
hydrangea is a string made of multiple sentences. spacyfunction is a function which takes that sentence and uses spacy to find its parts of speech, saving as a Pandas Dataframe.
from osmnx-examples.
@matthewstidham I'm not seeing what your code snippet has to do with OSMnx or the Jupyter notebook that this issue was opened for.
from osmnx-examples.
Related Issues (20)
- osmnx simplify_graph does not remove all intermediate nodes that are not intersections HOT 1
- Existing alternate isochrones example doesn't respect geometry of curved links HOT 2
- TypeError: unhashable type: 'dict' on first example in 00-osmnx-features-demo.ipynb HOT 5
- Install troubleshooting HOT 1
- TypeError: “Set type is unordered” in isochrones example with Pandas 1.1 HOT 1
- Finding all the edges connected to a node
- multiprocessing doesn't work in Jupyter HOT 1
- osmnx street network polar plot 1 bin backward than histogramas HOT 2
- Download whole state data HOT 1
- Fix binder link from master to main in README.md HOT 1
- Extracting boundaries with specified administrative level is not working correctly HOT 2
- [Question] would it be possible to show a trajectory (moving object) with Osmnx (stream plotting) HOT 1
- Am unable to use osmnx to get data for california, texas and some us state HOT 1
- module 'osmnx' has no attribute 'pois_from_point' HOT 1
- error in notebook 08 HOT 1
- Add Clustering Example by Network Distance
- fix: isocrones are not taking into account the time HOT 1
- AttributeError: module 'osmnx' has no attribute 'utils_graph' in 00-osmnx-features-demo.ipynb HOT 2
- examples update needed HOT 2
- Add example of attaching features to nearest nodes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osmnx-examples.