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
a | |
aa | |
aaa | |
aaron | |
ab | |
abandoned | |
abc | |
aberdeen | |
abilities | |
ability |
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
from django.db import models | |
from django.contrib import admin | |
from django.http import StreamingHttpResponse | |
import csv | |
class ExampleModel(models.Model): | |
field1 = models.CharField(max_length=100) | |
field2 = models.CharField(max_length=100) | |
field3 = models.EmailField(max_length=100) | |
# ... other fields ... |
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 threading | |
class LRUCache: | |
def __init__(self, capacity, concurrent=False): | |
self._capacity = capacity | |
self._concurrent = concurrent | |
self._cache = {} | |
self._lock = threading.Lock() |
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
def df_reduce_memory(df): | |
"""Reduce pandas dataframe memory size | |
Args: | |
df (pd.DataFrame): pandas dataframe | |
Returns: | |
pd.DataFrame: reduced pandas dataframe | |
""" | |
# Example: df = pd.read_csv(data_dir, parse_dates=True, keep_date_col=True) |