TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #32 · 7 фев.

Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks

Резултати

Пронајдени 1 слични објави

Пребарај: #abroad

当前筛选 #abroad清除筛选
Data Science Jobs

@datasciencejobs · Post #1878 · 18.01.2024 г., 13:01

#вакансия#remotely#abroad#удаленка#DataScientist Вакансия: Senior Data Scientist Локация: Рассматриваются кандидаты за пределами России и Белоруссии Занятость: Полная График работы: Гибкий Зарплата: $4000 – 4500 на руки Для связи: https://t.me/Tary_bird, [email protected] Описание: Ищем опытного Senior Data Scientist для участия в проекте крупного американского маркетингового агентства. Оформление в штат в Армении. Требуется владение английским не ниже уровня B2. Responsibilities: • Develop real-time prediction systems using geospatial machine learning algorithms. • Mine and extract usable data from valuable sources. • Advanced visualization of geo-temporal algorithms. • Use machine learning tools to select features, create and optimize classifiers. • Conduct preprocessing of structured and unstructured data. • Enhance systems using LLM AI models. • Improve data collection procedures for comprehensive analytic system development. Key Skills: • Programming: Knowledge of statistical programming languages like R, Python, and database query languages like SQL, Hive, Pig is desirable. Familiarity with Scala, Java, or C++ is an added advantage. • Statistics: Good applied statistical skills, including knowledge of statistical tests, distributions, regression, maximum likelihood estimators, etc. • Machine Learning: Good knowledge of machine learning methods like k-Nearest Neighbors, Naive Bayes, SVM, Decision Forests. • Strong Math Skills: Understanding the fundamentals of Multivariable Calculus and Linear Algebra is important. • Data Wrangling: Proficiency in handling imperfections in data. • Data Visualization: Experience with tools like Matplotlib, ggplot, d3.js., Tableau for visually encoding data. • Communication Skills: Ability to describe findings to both technical and non-technical audiences. • Software Engineering Background: Strong background in software engineering. • Hands-on Experience: With data science tools and a problem-solving aptitude. • Analytical Mind: Strong analytical skills and great business sense. • Degree: In Computer Science, Data Science, Mathematics, Statistics Preferred Additional Skills: • Experience with geospatial analysis and GIS. • Knowledge of H3 hierarchical geospatial indexing or other geospatial indexes. • Familiarity with open-source geographical datasets. • Experience or familiarity with advertising technology concepts. • Experience with artificial intelligence, especially with LLM and other generative technologies.