home.social

#itertools — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #itertools, aggregated by home.social.

  1. 261 combinations of 3 connected segments, on a 3x3 grid of points. Removing rotations and translations. #itertools
    The sketch-a-day archives and tip jar are at: abav.lugaralgum.com/sketch-a-d Code for this: github.com/villares/sketch-a-d #Processing #Python #py5 #CreativeCoding

  2. [Перевод] 10 приёмов профессионала для ускорения кода на Python

    Команда Python for Devs подготовила перевод статьи о том, как делать код на Python быстрее без переписывания проектов с нуля. В статье 10 практичных приёмов — от sets и bisect до локальных функций и предвыделения памяти — которые дают реальный прирост скорости в типовых сценариях.

    habr.com/ru/articles/969848/

    #python #оптимизация #оптимизация_кода #производительность #sets #bisect #itertools #память #циклы #скорость

  3. Магия itertools: Перестаньте писать велосипеды на циклах for

    Почему опытные Python-разработчики редко используют циклы for для обработки данных? Потому что императивный стиль на больших объемах данных ведет к исчерпанию памяти (OOM) и замедлению работы. Модуль itertools — это стандарт индустрии для создания эффективных конвейеров обработки данных. Он реализует концепцию ленивых вычислений (lazy evaluation), позволяя обрабатывать бесконечные потоки или огромные дампы БД, потребляя константный объем RAM.

    habr.com/ru/articles/969544/

    #itertools #python #python3 #python_для_начинающих

  4. Магия itertools: Перестаньте писать велосипеды на циклах for

    Почему опытные Python-разработчики редко используют циклы for для обработки данных? Потому что императивный стиль на больших объемах данных ведет к исчерпанию памяти (OOM) и замедлению работы. Модуль itertools — это стандарт индустрии для создания эффективных конвейеров обработки данных. Он реализует концепцию ленивых вычислений (lazy evaluation), позволяя обрабатывать бесконечные потоки или огромные дампы БД, потребляя константный объем RAM.

    habr.com/ru/articles/969544/

    #itertools #python #python3 #python_для_начинающих

  5. Ah yes, the age-old quest for #programming enlightenment: writing Fizz Buzz without so much as a hint of logic 🙄. Our intrepid coder Evan has managed to turn the venerable challenge into a Pythonic #circus act, cycling through sequences like a caffeine-fueled hamster on a wheel 🚴‍♂️. Who needs simplicity when you can overcomplicate everything with itertools? 🤹‍♂️
    evanhahn.com/fizz-buzz-without #FizzBuzz #Python #coding #itertools #HackerNews #ngated

  6. Ah yes, the age-old quest for #programming enlightenment: writing Fizz Buzz without so much as a hint of logic 🙄. Our intrepid coder Evan has managed to turn the venerable challenge into a Pythonic #circus act, cycling through sequences like a caffeine-fueled hamster on a wheel 🚴‍♂️. Who needs simplicity when you can overcomplicate everything with itertools? 🤹‍♂️
    evanhahn.com/fizz-buzz-without #FizzBuzz #Python #coding #itertools #HackerNews #ngated

  7. Ah yes, the age-old quest for #programming enlightenment: writing Fizz Buzz without so much as a hint of logic 🙄. Our intrepid coder Evan has managed to turn the venerable challenge into a Pythonic #circus act, cycling through sequences like a caffeine-fueled hamster on a wheel 🚴‍♂️. Who needs simplicity when you can overcomplicate everything with itertools? 🤹‍♂️
    evanhahn.com/fizz-buzz-without #FizzBuzz #Python #coding #itertools #HackerNews #ngated

  8. itertools для тех, кто думал, что знает itertools

    Привет, Хабр! Модуль itertools мне известен многим вдоль и поперёк. Ну действительно, что там сложного? Пара функций вроде chain да product , и кажется, что ничего нового для себя уже не найти. Однако стоит копнуть глубже, и выясняется, что у itertools есть немало нюансов и даже новых возможностей, появившихся в свежих версиях. В этой статье рассмотрим многие функции itertools : от базовых до самых интересных. Понять силу итераторов

    habr.com/ru/companies/otus/art

    #python #программирование #itertools #итераторы

  9. Ano passado eu gravei um curso em vídeo de introdução ao desenho com código, usando #Python + #Processing (#py5) para o HomeostasisLab, está disponível *totalmente de graça* em:

    homeostasislab.org/cursos/info

    Parece que uma centena de pessoas acessaram esse #cursoGrátis de #ProgramaçãoCriativa, mas eu não tive retorno. Estranhei que deveria ter legendas em inglês mas não as encontrei :((

    Adoraria que mais gente visse e que me mandassem comentários (de preferência construtivos). Assisti ontem um trechinho em que eu tento explicar #itertools #combinations #permutations e #ItertoolsProduct e achei que estava bem razoável.

    Se você gosta do meu trabalho, pode me apoiar em gumroad.com/villares, com PayPal (paypal.com/cgi-bin/webscr?cmd=) ou PIX (chave: 46c37783-5edb-4f1c-b3a8-1309db11488c)

  10. sketch_2022_06_19 #Processing #Python #py5 #itertools #combinations github.com/villares/sketch-a-d

    UPDATE: No need to use that cumbersome lambda, it was there because of some previous experiments... I refactored it out:
    ...
    for z, positions in zip(range(-100, 101, 20), cs):
    py5.fill((255 + z + i * 20) % 255, 200, 200)
    for pos in positions:
    element(pos + (z,))

  11. @pokateo use of python `itertools` to map `shapely` functions onto geometric linear and point objects

  12. #ArtAdventCalendar Day 4.

    I started working through the book "Indra's Pearls" by David Mumford, Caroline Series, and David Wright. And by working, I mean implementing the pseudo-code in #python. It's fun when you recognize that a messy triple-nested loop algorithm in the book can be replaced by a single `itertools.product` followed by a `filter` call - which makes one appreciate the ease of coding in Python!

    This is a "Theta-Schottky group" fractal inspired by Exercise 4.2 in the book.

    #indraspearls #fractal #schottkygroup #itertools

  13. ♻️ Master the art of efficient looping! Join Pratibha Jagnere in the talk "Itertools – iterators for efficient looping" and level up your Python skills. 🚀🔁 Don't miss it: cz.pycon.org/2023/program/talk
    #Python #Itertools #PyConCZ23

  14. Today I implemented some neat optimizations for my current project at work: the problem I found was that the #rust #itertools library does not ensure minimal allocation size for the partition_result adaptor.

    I made a custom implementation of this adaptor that does not allocate itself, but receives preallocated collections for the partitions.

    Was a pretty nice experience.

  15. Ano passado eu gravei umas aulas em vídeo para o HomeostasisLab, é de graça, sobre desenhar com #Python e #py5 e um pouquinho de #itertools homeostasislab.org/cursos/info

  16. sketch_2022_02_21 #Processing #Python #py5 #itertools combinações de 7 pontos de um heptágono ligados dois a dois por linhas tracejadas.

  17. #ArtAdventCalendar Day 4.

    I started working through the book "Indra's Pearls" by David Mumford, Caroline Series, and David Wright. And by working, I mean implementing the pseudo-code in #python. It's fun when you recognize that a messy triple-nested loop algorithm in the book can be replaced by a single `itertools.product` followed by a `filter` call - which makes one appreciate the ease of coding in Python!

    This is a "Theta-Schottky group" fractal inspired by Exercise 4.2 in the book.

    #indraspearls #fractal #schottkygroup #itertools

  18. #ArtAdventCalendar Day 4.

    I started working through the book "Indra's Pearls" by David Mumford, Caroline Series, and David Wright. And by working, I mean implementing the pseudo-code in #python. It's fun when you recognize that a messy triple-nested loop algorithm in the book can be replaced by a single `itertools.product` followed by a `filter` call - which makes one appreciate the ease of coding in Python!

    This is a "Theta-Schottky group" fractal inspired by Exercise 4.2 in the book.

    #indraspearls #fractal #schottkygroup #itertools

  19. #ArtAdventCalendar Day 4.

    I started working through the book "Indra's Pearls" by David Mumford, Caroline Series, and David Wright. And by working, I mean implementing the pseudo-code in #python. It's fun when you recognize that a messy triple-nested loop algorithm in the book can be replaced by a single `itertools.product` followed by a `filter` call - which makes one appreciate the ease of coding in Python!

    This is a "Theta-Schottky group" fractal inspired by Exercise 4.2 in the book.

    #indraspearls #fractal #schottkygroup #itertools

  20. #ArtAdventCalendar Day 4.

    I started working through the book "Indra's Pearls" by David Mumford, Caroline Series, and David Wright. And by working, I mean implementing the pseudo-code in #python. It's fun when you recognize that a messy triple-nested loop algorithm in the book can be replaced by a single `itertools.product` followed by a `filter` call - which makes one appreciate the ease of coding in Python!

    This is a "Theta-Schottky group" fractal inspired by Exercise 4.2 in the book.

    #indraspearls #fractal #schottkygroup #itertools