Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
NoteSummary PyCamp is the kind of community event that recharges your batteries and restores your hope that another way of relating to one another, beyond stressful competition and selfish goals, is not only possible but very real and achievable if we cre…
-
NoteTL;DR When defining a Python-based Kubeflow Pipeline component, you typically list dependencies using the packages_to_install argument in kfp.dsl.component or by baking them into a custom Docker image.
-
NumFocus organized a hackathon, the NumHack 2024, and together with Jurij Wollert and Francesco Bruzzesi I participated.
-
JSON Lines is a common format encountered in modern data applications, as stated in this documentation: The JSON Lines text format, also called newline-delimited JSON, is a convenient format for storing structured data that may be processed one record at a
-
NoteSummary If parsing and validating the request significantly contributes to the processing time, there might be room to optimize your FastAPI REST API.
-
NoteTL;DR Numpy’s bytes format can be considerably faster than other formats to deserialize.
-
This post contains the code behind this video explanation: Code import torch from torch import tensor import numpy as np import torch.nn.functional as F from torch.utils.data import DataLoader, Dataset from torch.nn.utils.rnn import pad_sequence Imagine a…
-
seaborn makes our life easy when it comes to slicing and plotting data in Python.
-
The built-in collections module is a handy bag of tools to be aware of.
-
The situation This is a question on Stackoverflow: “Why do I get only one parameter from a statsmodels OLS fit?”
-
Merging dictionaries Say we have these two dictionaries that we would like to merge: d1 = {"a": 1, "b": 2} d2 = {"a": 2, "c": 3, "d": 4} A kind of cannonical way to do it would be this: d3 = {} for d in [d1, d2]: for k, v in d.items(): d3[k] =…
-
Let’s look at a common pattern in Python code: numbers = range(10) list(numbers) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] def square(x): return x**2 results = [] for n in numbers: results.append(square(n)) results [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] That’s…
-
TL;DR: pandas.read_csv considers the word “null” as a NaN, which also means “zero” in German.
-
TL; DR: Only use the form array *= something if you’re 100% sure you are doing the right thing, otherwise, just go for array = array * something.
-
It’s not about the projections for the rest of 2020, I promise.
-
TL; DR: If you need to compute many vector pairwise metrics in batches, try sklearn.metrics.pairwise_distances_chunked The problem I had to compute pairwise cosine distances for a large list of high-dimensional vectors (e.g. word embedding).