Skip to content

Instantly share code, notes, and snippets.

View Marinell0's full-sized avatar
🏠
Working from home

Marinello Marinell0

🏠
Working from home
View GitHub Profile
@Marinell0
Marinell0 / filter_lines_from_zip_csv.py
Last active April 17, 2024 14:48
Filter lines from a csv file inside a zip. It does this in an efficient way so to not waste time on doing this.
import pandas as pd
import zipfile
import io
import re
from typing import Iterator
def rows_with_index(pattern, sep, file) -> Iterator[str]:
row_index = 0
for row in io.TextIOWrapper(file):
@Marinell0
Marinell0 / load_docker.md
Created October 25, 2023 12:31
How to load NVidia CUDA docker with Tensorflow

Check if Nvidia driver is working:

nvidia-smi -a

Output should display GPU information.

Docker NVidia

How to install Nvidia-ctk

@Marinell0
Marinell0 / parallelize.py
Last active April 4, 2024 16:58
Parallelize any python function
import collections.abc
from concurrent.futures import ThreadPoolExecutor, Future
from typing import Callable, Iterable, List, TypeVar
import os
from tqdm import tqdm
T = TypeVar('T')
R = TypeVar('R')