This file contains hidden or 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 pandas as pd | |
import numpy as np | |
from tqdm import tqdm | |
def reduce_mem_usage(df): | |
""" | |
From https://www.kaggle.com/valleyzw/ubiquant-lgbm-baseline | |
Iterate through all the columns of a dataframe and modify the data type to reduce memory usage. | |
""" |
This file contains hidden or 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
group_user_relation = db.Table( | |
'group_user_relation', | |
db.Column('group_id', db.Integer, db.ForeignKey('group.id')), | |
db.Column('user_id', db.Integer, db.ForeignKey('user.id')) | |
) | |
class User(db.Model): | |
id = db.Column(db.Integer, primary_key=True) | |
username = db.Column(db.String(64), unique=True) |