A list of puns related to "Many to many (data model)"
I am trying to link two tables in the Data Model. I get an error message, "The relationship cannot be created because each column contains duplicate values. Select at least one column that contains only unique values."
This should be a one-to-many relationship. The unique side of that relationship is just a concatentation of country name + ZIP code. I've trimmed/cleaned, removed duplicates, pivoted and counted, Group-By counted, loaded to Table and tested in Excel, etc. Basically tested for duplicates in several ways, and these values are absolutely unique.
Any ideas? I doubt this is an error on Excel's part, since I would imagine this feature is pretty damn robust.
I'm trying to write an application where players can be members of many leagues (a has_many through). I've managed to get that far. Conversely, a league has many users. Not too difficult for the most part. After that, a league has many seasons and a season has many games. This is where I'm getting confused. A game should have many players, but only players that are a subset of the league they're in. So, a league might have 6 players total, but a game might only have 4 of those players. I'm stuck trying to figure out how to make this association work. Should game have many players through a join table called "game_players" and have many "game_players" through the league_memberships join table? I think I need a separate join table, but I'm not 100% sure.
EDIT: I should add that the players of the game will "has_one" "score", which will keep track of statistics for that game.
My work gives me access to Lynda/Linked In Learning and after completing several courses I decided Iβd start an Excel Business Analytics course. Itβs main focuses are Power Query (Get & Transform), Data Models and finally Power Pivot and DAX.
After the brief into covering what they all are capable of, I was kind of blown away. Outside of a single person no one in my organisation that I interact with uses this stuff and it seems incredibly powerful. My mind was instantly flooded with existing workflows and new projects that could use this.
I see to see a lot of people mentioning power query on this sub, but do many of you use the Data Model? Seems great for setting up smaller projects that wouldnβt warrant using a real database. What are you thoughts? Do you find this (as well as Power Query / Power Pivot / DAX) useful enough to use day to day?
This is the best tl;dr I could make, original reduced by 97%. (I'm a bot)
> Numerous clinical trials have confirmed that the method is effective, and in 2001 Sinclair published a paper in the journal Alcohol and Alcoholism reporting a 78 percent success rate in helping patients reduce their drinking to about 10 drinks a week.
> His ideas came to be illustrated by a chart showing how alcoholics progressed from occasionally drinking for relief, to sneaking drinks, to guilt, and so on until they hit bottom and then recovered.
> Researchers at the National Council on Alcoholism charged that the news would lead alcoholics to falsely believe they could drink safely.
> If Betty Ford and Elizabeth Taylor could declare that they were alcoholics and seek help, so too could ordinary people who struggled with drinking.
> These changes gradually bring about a crucial shift: instead of drinking to feel good, the person ends up drinking to avoid feeling bad. Alcohol also damages the prefrontal cortex, which is responsible for judging risks and regulating behavior-one reason some people keep drinking even as they realize that the habit is destroying their lives.
> In a follow-up study two years later, the patients had fewer days of heavy drinking, and more days of no drinking, than did a group of 20 alcohol-dependent patients who were told to abstain from drinking entirely.
Summary Source | FAQ | Feedback | Top keywords: drink^#1 alcohol^#2 treatment^#3 patient^#4 research^#5
Post found in /r/todayilearned, /r/alcoholicsanonymous, /r/9M9H9E9, /r/TrueReddit, [/r/psychology](http://np.reddit.com/r/psychology/comments
... keep reading on reddit β‘Ok, Im am trying to figur out how to best structure this incoming data to make analysis later possible/easy.
Imagine you will get data of students withs exam grades in many subjects. You also have data of universities with lower limits of accaptance for a set of subjects (each U has a different sets, but many subjects overlap).
In the analysis later you will want to select a university and get insights in to which students are passing in the different subjects, the deviation from lower limits in the U's set of subjects, rate the students by grad in that universitis set of subjetcs etc. So the main thing is that you want to filter subjects by U, and analyse/use the lower limit in each sucject of that U.
I think whats wraping my head is that the only thing linking the students and the universities is the subjects. So my idea is to build two tables, one with students with grades in subjects and one with universities with lower limits in subjects. But doing it this way I will have a many to many relationship as there are many repeting subjects in the both the student table and the universities tabel.
This could lead to many-to-many questions (have not tried that before), and maby it is, but somehow I feel that Im missing something obvious here, that there is a much simpler solution to this? Maby excel is a better place to solve this?
Ideas?
I am making a database for a collectible card game in effort to keep track of cards owned and possible wishlist.
When I started designing the data model I was thinking of 2 tables. A CARD table that has the information for each individual card, and a COLLECTION table that would hold the information for quantity owned of a specific card. The CARD table is where I am having the most questions and could use some outside input.
Originally I was thinking that since there are multiple card types (i.e. Character, Equipment, Plot-Twist, and Action) I decided that a CARD_TYPE table may be needed for the sake of normalization. The CARD_TYPE table would have a one to many relationship with the CARD table.
Digging deeper into it I find where I am having the most issues is with the fact that each card type I listed above has it's own set of specific attributes (i.e. Character has defense and attack, Equipment has a bonus, Plot-Twists have a duration, etc..). I would think that these attributes should be in the CARD table since they hold information related to a specific card. However this would mean each record in the CARD table would have all of the attributes a card could have, but those that didn't pertain (i.e. Duration for a Character card) would be null. This doesn't seem right to me from a structural/normalization, but I am not sure maybe I am over thinking it.
The other option I had thought of was to create a table for each specific card type, but that seems like it would make querying for an entire collection rather messy and error prone.
In any case if someone has some other thoughts or ideas they are for sure welcome. I am no expert in this arena so any input is appreciated.
I said, βIβm not sure. Itβs so hard to keep track.β
Everything is pretty much in the title so this body is just a placeholder to not get automoderatorwhacked.
I am completely confused about how to add data to a db with a many-to-many relationship.
What I'm working on is a small flashcard app that allows users to learn a list of words (language learning).
But I'm not sure how I should add words for a particular Student Course combo.
models.py
class Language(Model):
name = CharField(max_length=60)
class Course(Model):
name = CharField(max_length=60)
description = TextField()
language = ForeignKey(Language, on_delete=SET_NULL, null=True)
class Word(Model):
word = CharField(max_length=60)
language = ForeignKey(Language, on_delete=PROTECT)
class StudentCourse(Model):
course = ForeignKey(Course, on_delete=CASCADE)
student = ForeignKey(User, on_delete=CASCADE)
words = ManyToManyField(Word, through='courses.WordProgress')
class WordProgress(Model):
student_course = ForeignKey(StudentCourse, on_delete=CASCADE)
word = ForeignKey(Word, on_delete=CASCADE)
last_review = DateTimeField(auto_now_add=True)
next_review_sec = IntegerField(default=60)
I have added data to Language
, Course
, Word
, and User
. But where I get stuck is how I can initialize a course with a set of words. How is ManyToManyField
populated? I've seen some suggestions that it should be an array? In my case, should it be an array of words? i.e. {course: 1, user: 1, words: [1, 2, 3]}
Or is this populated in some other way? Also, does through
have an impact on any of this?
Thanks for your help -- it is greatly appreciated!
I'm working on a data set that is decently large, >2 million rows. One of the features is a serial number for a product (so probably decently important). Usually, I would OneHotEncode them, but this isn't really possible because having 5000 columns would break my model. Any suggestions for how you would deal with this? Thanks.
Edit: Some clarification. This is a pretty massive dataset, with over two million rows. I have two variables of concern. One is the ad campaign, of which there are 5704 unique values. The other is the product number of the game being played when the advertisement launches, which has >29k unique features. When predicting clicking on an ad in a mobile game, I think both are probably too important to drop. The other thing is, I'm aware that it isn't realistic or super intelligent to have these as features, but this is a take home technical interview, so it's part of the challenge to make due. Thanks again everyone for your thoughtful answers.
I am analyzing a survey of about 30 questions. All of the survey questions are on a likert scale from 1 to 10. The demographic information is categorical. For example age is "18-25", "25-45",... not numeric.
The goals of this analysis are unclear, but thankfully it is exploratory so I am not overly concerned about controlling error rates. The goal, though, is to explain support of several types of policy (measured on a likert scale). The PI would like to see why people support certain types of policy (not a causal claim) . I do not think this is possible, but maybe I am wrong.
I have no idea how to actually model this. Traditional regression modeling seems out of the question. There are around ten types of policy they want explained. I would have to run 10 regression models, changing the independent variable each time. I am not concerned with strictly controlling the Type I error because this is exploratory, but I do not trust results from so many regression models. I will definitely chase a false positive. Another complication is that everything is either 0-to-10 likert or categorical.
Does anyone have any similar experience? The high level problem is analyzing likert survey data with many variables of interests.
We are still actively working on developing a DB diagram for the site and once we have that, we are going to implement the appropriate models and get those into the DB. Then we are going to work hard on getting the endpoints working so the front-end developers can start working with data and ensuring that it all works as it is supposed to. This is just a brief overview of what we are doing so you have an idea of what we are working on before coming on-board.
The skills I am looking for, though not required are:
If you think you can help out, even if you have never touched any of this before, please let us know! Some of these concepts are not terribly difficult to learn and would require a few hours of playing around with the code to get an idea of how things work in addition to reading up on the docs for FastAPI.
You can view FastAPI here: https://fastapi.tiangolo.com/features/ I look forward to working with you and thank you for any help or assistance you can provide to help get this project off the ground.
Please take a look at the pinned post for onboarding instructions and how to get started. Thank you!
Discord Link - Join Us: https://discord.gg/Ctu3c3w
Why does it have to be a group activity
I said, "Canβt say for sure, itβs so hard to keep track!"
At least on some subs including this one it has become almost impossible to engage in objective conversations that are not loaded by preemptive ideas, subjective emotions and assertions.
This post presents an analysis of how many Rotten Tomatoes user reviews are likely sufficient for a given movie's audience score to be reasonably close to the final audience score. For analysis purposes, I'll make the possibly unwarranted assumption that the arrival of user reviews over time is random. This assumption allows us to model the user reviews that exist at an earlier point in time as a random sampling of the user reviews that exist at a later time. More specifically, let's address the question "Assuming that the arrival of user reviews over time is random, at what number of user ratings is it likely sufficient that the audience score will be within 1 percentage point of the final audience score?"
The displayed audience score appears to always be an integer, which I'll assume is rounded to the nearest integer. Let the variable FR = the displayed rounded final audience score, which is an integer. Let the variable FP = the pre-rounded final audience score, which is a real number known to Rotten Tomatoes but unknown to the public. Let the variable SR = the displayed rounded audience score at some point in time, which is an integer. Let the variable SP = the pre-rounded value of SR, which is a real number known to Rotten Tomatoes but unknown to the public. Our question therefore can be stated as "Assuming that the arrival of user reviews over time is random, at what number of user ratings for SR is it likely sufficient that (FR - 1) <= SR <= (FR + 1)?" Since the random sampling theory that we will be using uses real numbers, to take into account rounding, the real number range that we're interested in is (FR - 1) - 0.5 <= SP <= (FR +1) + 0.4999999999. Our question therefore can be stated as "Assuming that the arrival of user reviews over time is random, at what number of user ratings for SP is it likely sufficient that (FR - 1.5) <= SP <= (FR + 1.4999999999)?"
The random sampling theory that we will use requires specification of the desired margin of error percentage for the calculation of the sample size needed to have a specified confidence level that the population value is within the margin of error percentage of the sample value. In our case the population is the user reviews that FP is calculated from, the population value is FP, the sample is the user reviews that SP is calculated from, and the sample value is SP. The value of FP for which the difference between FP and (FR - 1.5) [the left side of our desir
... keep reading on reddit β‘So every year, according to this site, there are at least handful of teams that are 53% or above against the spread meaning if you had bet on them every single game you would have profited. Most years there are teams hovering around 60% too (for example this year the Kings are 62.1% ATS, last year Boston was 62.6%). Thatβs a whole lot of potential profit
Trends can be viewed here: https://www.teamrankings.com/nba/trends/ats_trends/?range=yearly_2017_2018
My question is after how many games at the start of an NBA season do these trends usually appear where they can be considered reliable? 20 games? To the point where you can blindly lay money down on a team the remainder of the season and be pretty sure of profit?
Discuss
Thanks
It means a lot.
According to Luca Zaia, Governor of Veneto, everyone in Voβ Euganeo has been tested for Coronavirus. The positivity rate is 1.7%.
Voβ Euganeo is the town in which the first cases of Coronavirus in Veneto have appeared.
Only 2. But the real question is, how did they get in there?
If any. The field progresses so quickly that it's hard keeping up to date with everything. How do you do it?
Hey there, Iβm working on a website dedicated to classic cars, and Iβm looking for different datas of which the remaining number of cars « still aliveΒ Β» by model and years.
As an example: I know that there has been exactly 318 Jaguar E-Type Serie 1 4.2L Fixed-head Coupe Right Hand Driving produced in 1966
How to know how many are totally destructed and how many are still alive on a global scale?
Any ideas to share? Best Piem
Many have correctly identified the problem of government and the corporation. What is missing is a sound game theoretical design to manifest a peer-to-peer solution in an adversarial environment. If we are going to achieve the peer-to-peer vision, we must do so through economic persuasion. Neither government nor the corporation is going to willfully give up its power. If we are to succeed, we must create a new solution which makes the old obsolete. Fortunately there is a way to do this.
The core value proposition of all business models is trust/identity. All businesses match a buyer and a seller and collect a fee for doing so. The reason we are reliant on centralized businesses is because we cannot establish trust among two peers without going through a centralized intermediary. If we solve this problem, then we have made the centralized business obsolete.
A system of peer-to-peer trust can be rather easily built on the blockchain. Users register their identity to a designated Bitcoin address and link all of their profile characteristics/data to this identity. Attestation from peers is used to build a public profile. Using this public immutable profile, instead of the individual broadcasting trade requests to a single monopoly provider like Facebook, Uber, eBay, Netflix, etc, the user broadcasts trade requests to thousands of competing matchmakers. Each matchmaker recreates a complete copy of the network. All prospective counterparties can verify the trustworthiness of each other on the blockchain. They need not trust the monopolized intermediary to verify each other's reputation. By solving peer-to-peer trust, you have eliminated the very thing that allows corporations to attain monopolies -- the network effect.
By eliminating the network effect of trust, the centralized business is made obsolete. By making the centralized business obsolete, government is indirectly made obsolete. Government has no power without the centralized business implementing its decrees out of fear of getting shut down. It simply cannot control an economy of billions of individuals transacting peer-to-peer. By making the centralized business and government obsolete, the cost of trade is reduced 40%+. This is because the cost of the middleman, regulation, and extortion is removed from trade as it cannot be enforced in a peer-to-peer framework. Users will join this system not out of ideological persuasion, but because they personally profit from it.
It ended my Korea.
Ten tickles....
Iβm not sorry.
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.