Tag: python

  1. Updated

    Calculate the similarity of two vectors

    Category: AI, Python

    You should only calculate Pearson Correlations when the number of items in common between two users is > 1, preferably greater than 5/10. Only calculate the Pearson Correlation for two users where they have commonly rated items.

  2. Updated

    Simple Parallel Tasks in Python: concurrent.futures

    Category: Python

    concurrent.futures is well suited to Embarrassingly Parallel tasks. You could write concurrent code with a simple for loop.

  3. Updated

    Create a custom migration in Django

    Category: Database, Python

    ALTER TABLE app_repostarring CHANGE repo_description repo_description VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

  4. Updated

    Lazy evaluation in Django middlewares

    Category: Python, Web Development

    Attach a lazy evaluated function as a property of request in a middleware.

  5. Updated

    Setup Jupyter and other Machine Learning tools on macOS

    Category: AI, Python

    Jupyter Notebook is an interactive environment for running code in the browser. It allows you to create interactive documents that contain live code, rich text elements and visualizations. It's also a widely used tool for Data Scientists to make prototypes or demonstrations.

  6. Updated

    IPython: the Python REPL interpreter

    Category: Python

    IPython is a neat alternative of Python's builtin REPL (Read–Eval–Print Loop) interpreter, also a kernel of Jupyter.

  7. Updated

    Speed up Python and Node.js builds on Travis CI

    Category: DevOps, JavaScript, Python

    For Python and Node.js projects, you could totally cache both site-packages and node_modules directories in every Travis CI build.

  8. Updated

    Configure i18n Translations in Django

    Category: Python, Web Development

    Internationalization and localization for your Django project.

  9. Updated

    Python is call-by-assignment

    Category: Python

    If you pass a mutable object into a method, the method gets a reference to that same object and you can mutate it to your heart's delight, but if you rebind the reference in the method, the outer scope will know nothing about it, and after you're done, the outer reference will still point at the original object. If you pass an immutable object to a method, you still can't rebind the outer reference, and you can't even mutate the object.

  10. Updated

    Upload files to Amazon S3 when Travis CI builds pass

    Category: DevOps, Python, Web Development

    CAUTION! By default, only master branch's builds could trigger deployments in Travis CI.