Answer the question
In order to leave comments, you need to log in
Is it worth using a graph and in what cases are they used?
Hello. I faced the following problem: there is a division of users into men and women, for men there is immediately a breakdown by age with data binding, and for women, first it goes by pregnant / lactating / normal and then by age with data:
data: женщина, беременная, 18-30, набор_данных1
data: женщина, нормальная, 18-30, набор_данных2
data: мужчина, 15-18, набор_данных3
data2:...
a = {
'female': {
'pregnant': {'18-30': 'data_set'},
...
},
'male': {'15-18': 'data_set2'}
}
user_data = a[gender][status][age_range]
Answer the question
In order to leave comments, you need to log in
For analytics - it's better to stay in sql
For ease of writing - also
If you want to suffer and pull an owl on the globe - use graph databases
If I understand the question, then do everything too, but on a NoSQL basis. For example mongo. Everything is in json if I understand nosql correctly
You missed the section on data structures in python. Graphs are not for such tasks. In your case, you need:
collection = defaultdict(list)
key = ("male", "18-25")
data = ...
collection[key].append(data)
Well, continue to twist this data structure
Graphs for finding paths. There is almost no application for business tasks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question