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

Резултати

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

Пребарај: #financialinnovation

当前筛选 #financialinnovation清除筛选
AI & Law

@ai_and_law · Post #107 · 08.09.2023 г., 07:04

CFA Institute Releases the Handbook of Artificial Intelligence and Big Data Applications in Investments Hello, dear subscribers! Explore the latest from the CFA (Chartered Financial Analyst) Institute Research & Policy Center - a comprehensive handbook authored by Larry Cao, CFA. It's your guide to decoding the dynamic world of investments powered by artificial intelligence (AI) and big data. As AI and big data weave deeper into investment processes, the CFA Institute aims to equip industry professionals to evaluate and incorporate these elements effectively. They emphasize the importance of practical insights alongside technical knowledge and recognize the value of early adopters' experiences in technology implementation. The Handbook can be useful for: ✅ C-suite executives and board members shaping their firms' AI and big data strategies ✅ Knowledge engineers leading AI and big data projects at investment firms ✅ Investment and tech professionals working on AI-driven teams ✅ Regulators staying updated on industry developments ✅ Students and educators preparing for future roles in investments or regulation #CFAInstitute#AI#BigData#Investments#FinancialInnovation#EthicalInvesting#AIandFinance

Crypto M - Crypto News

@CryptoM · Post #64680 · 09.04.2026 г., 13:56

🚀 Wyoming's Digital Asset Regulation Discussed in Senate Roundtable U.S. Senator Cynthia Lummis, chair of the Senate Digital Assets Banking Subcommittee, hosted a roundtable at the Wyoming State Capitol. According to Foresight News, the event included discussions with Comptroller Jonathan V. Gould and Governor Mark Gordon on the state's current digital asset regulatory landscape, the significance of a dual banking system, and how banking regulation can support responsible financial innovation. Lummis emphasized Wyoming's leadership in the digital asset sector, noting that efforts initiated nearly a decade ago in the state have laid the groundwork for current federal initiatives. She highlighted Wyoming's comprehensive digital asset regulatory framework and expressed the importance of Comptroller Gould's visit to ensure federal policies reflect effective practices. #Wyoming#DigitalAssets#Regulation#Senate#Banking#FinancialInnovation#Cryptocurrency#USPolitics

Crypto M - Crypto News

@CryptoM · Post #65079 · 10.04.2026 г., 20:28

🚀 Stablecoin Reward Negotiations Intensify Ahead of Senate Vote Negotiations over stablecoin rewards are gaining momentum as lawmakers prepare to reconvene next week. According to NS3.AI, the Senate Banking Committee is set to vote on a comprehensive crypto market structure bill by the end of the month. A recent report from White House economists suggests that stablecoin rewards are unlikely to significantly impact bank lending or broader credit conditions. However, banking advocates are pushing for stricter language on yield prohibitions, while crypto firms argue that such limits could stifle innovation. #Stablecoin#Crypto#SenateVote#Banking#CryptoRegulation#FinancialInnovation#YieldLimits#CreditConditions

Crypto M - Crypto News

@CryptoM · Post #65370 · 13.04.2026 г., 02:55

🚀 Hong Kong Adopts Cautious Approach to Stablecoin Regulation Hong Kong's Financial Secretary, Paul Chan, announced on April 13 that the region will adopt a cautious approach to stablecoin regulation by initially issuing a limited number of licenses. According to BlockBeats, applicants must demonstrate practical application scenarios before further licenses are considered, allowing for experience to be gathered and evaluated. Chan emphasized the need to balance encouraging financial innovation with risk management, including the establishment of anti-money laundering regulatory mechanisms. He highlighted that while stablecoins offer decentralization and efficiency, they should be viewed primarily as payment tools rather than investment instruments. In light of the current international and security environment, Chan stressed the importance of vigilance. Hong Kong aims to enhance its financial market competitiveness and global influence as a form of proactive defense. The government and financial institutions have already established a comprehensive, cross-market monitoring system to ensure market stability. #HongKong#Stablecoin#Regulation#FinancialInnovation#RiskManagement#AML#Payment#GlobalFinance#MarketStability

Venture Village Wall 🦄

@venturevillagewall · Post #4100 · 08.02.2025 г., 16:00

U.S. States Embrace Bitcoin Reserves A surge in U.S. states pursuing legislation for strategic bitcoin reserves highlights increasing institutional interest in cryptocurrency. 15 states, including Alabama, Arizona, Florida, and Texas, are taking steps to incorporate bitcoin into financial strategies, aimed at attracting businesses and enhancing economic stability. The federal conversation on a national reserve is beginning, as states like Arizona and Utah are closest to legislative success. This movement reflects a broader trend recognizing bitcoin's potential as a financial tool. #Bitcoin#Crypto#Finance#Legislation#Investment#Blockchain#Arizona#Texas#Alabama#EconomicStability#PublicFunds#DigitalAssets#Utah#Kentucky#InstitutionalInterest#VC#SBR#MarketTrends#FinancialInnovation