This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# continued from https://gist.github.com/pulkitpahwa/d70d6855b5fba23f5b439b1cae556ad1 | |
a = Counter({"tata": ["tiago", "nano"]}) | |
b = Counter({"tata": ["nexon"]}) | |
c = a + b | |
print(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# continued from https://gist.github.com/pulkitpahwa/a42aaafa4d6290a453299cec6bce64fc | |
from collections import Counter | |
may_2020 = Counter(may_2020) | |
june_2020 = Counter(june_2020) | |
sum_may_june_2020 = may_2020 + june_2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# continued from https://gist.github.com/pulkitpahwa/a42aaafa4d6290a453299cec6bce64fc | |
sum_may_june_2020 = {} | |
for car, units_sold in may_2020.items(): | |
sum_may_june_2020[car] = sum_may_june_2020.get(car, 0) + units_sold | |
for car, units_sold in june_2020.items(): | |
sum_may_june_2020[car] = sum_may_june_2020.get(car, 0) + units_sold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
may_2020 = {"tata altroz": 1379, "tata tiago": 857, "tata nexon": 623, "tata harrier": 161, "tata tigor": 132} | |
june_2020 = {"tata tiago": 4069, "tata altroz": 3104, "tata nexon": 3040, "tata harrier": 3040, "tata tigor": 553} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
from django.db import models | |
# assuming we have our User model implemented in the users app | |
from users.models import User | |
class Contest(models.Model): | |
# I prefer using UUID field instead of auto increment for storing id | |
id = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Installation Steps | |
For Mac and Linux users | |
1. Go to Anaconda page (link: https://www.anaconda.com/download). Download and install the Python 3.6 version. For more info, you can visit this webpage (Mac users: https://docs.anaconda.com/anaconda/install/mac-os, Linux users: https://docs.anaconda.com/anaconda/install/linux) | |
2. Create a FloydHub account (link: https://www.floydhub.com/signup). Make sure you create a FloydHub account with the same email address with which you have registered for DataHack Summit 2017. Only then we will be able to assign GPU credits. | |
3. Install FloydHub in your system by going to the terminal by executing |