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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #83 · 11 мај

У строки в Python есть два очень похожих метода. На столько похожих что кажется они делают одно и тоже. Это метод isdigit() и isnumeric() Давайте посмотрим зачем нам два одинаковых метода? И так ли они одинаковы? Очевидно что isdigit() говорит нам, состоит ли строка только из чисел 0-9 >>> '12'.isdigit() True >>> '12x'.isdigit() False >>> '-12'.isdigit() False >>> '12.5'.isdigit() False Можно предположить что isnumeric() делает более глубокий анализ и распознаёт в строке float или отрицательное число. >>> '15'.isnumeric() True >>> '-15'.isnumeric() False >>> '15.2'.isnumeric() False Нет, всё так же как и с другим методом. В чем же тогда разница? Для начала посмотрим следующие примеры: >>> '5'.isdigit(), '5'.isnumeric() # Обычная цифра 5 # True, True >>> '꧕'.isdigit(), '꧕'.isnumeric() # Яванская 5 # True, True >>> '෩'.isdigit(), '෩'.isnumeric() # Синхала 3 # True, True >>> '৩'.isdigit(), '৩'.isnumeric() # Бенгальская 3 # True, True >>> '༣'.isdigit(), '༣'.isnumeric() # Тибетская 3 # True, True >>> '³'.isdigit(), '³'.isnumeric() # 3 верхний индекс (степень) # True, True >>> '𝟝'.isdigit(), '𝟝'.isnumeric() # Математическая двойная 5 # True, True >>> '๔'.isdigit(), '๔'.isnumeric() # Тайская 4 # True, True >>> '➑'.isdigit(), '➑'.isnumeric() # 8 в круге # True, True А теперь примеры в которых, по мнению Python, результаты не равны >>> '¾'.isdigit(), '¾'.isnumeric() # дробь три четверти # False, True >>> '⅕'.isdigit(), '⅕'.isnumeric() # дробь одна пятая # False, True >>> '𒐶'.isdigit(), '𒐶'.isnumeric() # клинопись 3 # False, True >>> '三'.isdigit(), '三'.isnumeric() # 3 из унифицированной идеограммы # False, True >>> '⑩'.isdigit(), '⑩'.isnumeric() # цифра 10 в круге # False, True >>> 'Ⅳ'.isdigit(), 'Ⅳ'.isnumeric() # Римская 4 # False, True >>> '𑇪'.isdigit(), '𑇪'.isnumeric() # Сенегальская архаическая 10 # False, True >>> '𐌢'.isdigit(), '𐌢'.isnumeric() # Этрусская цифра 10 # False, True >>> 'ↂ'.isdigit(), 'ↂ'.isnumeric() # Римская цифра 10000 # False, True >>> '〇'.isdigit(), '〇'.isnumeric() # Символ ККЯ ноль # False, True Получается, что isdigit() говорит нам, является ли символ десятичной цифрой или спецсимволом, имеющим цифирное значение после преобразования. В свою очередь isnumeric() включает все дополнительные символы юникода которые имеют отношения к числовым и цифровым представлениям. Ну и пара примеров в которых в обоих случаях символ не является числом, это эмодзи. >>> '🕙'.isdigit(), '🕙'.isnumeric() # эмодзи 10 часов # False, False >>> '7️⃣'.isdigit(), '7️⃣'.isnumeric() # эмодзи 7 # False, False Также есть еще один дополнительный и весьма полезный метод isdecimal(). Он нам сообщает, можно ли из указанного символа сделать простую десятичную цифру. То есть сработает ли метод int(x) >>> '෩'.isdecimal(), int('෩') # Синхала 3 # True, 3 >>> '➑'.isdecimal(), int('➑') # 8 в круге # False, ValueError Какие выводы? 🔸 При определении цифры в строке isdigit() подходит лучше чем isnumeric(), но оба не гарантируют успешную конвертацию в int 🔸 Для однозначного определения возможности преобразования строки в int лучше подходит метод isdecimal() 🔸 Для однозначного определения символов 0...9 лучше использовать regex Полный список символов юникода которые определяются как numeric #basic

Hashtags

Резултати

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

Пребарај: #gamestop

当前筛选 #gamestop清除筛选
404 Information

@Info404 · Post #65703 · 05.05.2026 г., 10:40

GameStop 提出 560 亿美元收购 eBay 的要约 据《华尔街日报》报道,GameStop 已向 eBay 提出以 560 亿美元收购的要约,这一举措是其 CEO Ryan Cohen 计划的一部分:把线上市场打造为“名副其实的亚马逊竞争对手”。 eBay 在周一发布的公告中表示,将“仔细审阅”这项未征求意见的提案,并称在收到该出价之前,双方并未就此进行任何沟通或联系。 GameStop 称,它将通过动用公司资产负债表中的 94 亿美元,并结合第三方融资来为这项收购筹资,其中包括 TD Securities 提供的最高 200 亿美元。 《华尔街日报》指出,公司并未披露其将如何为收购的其余部分融资;不过据知情人士向该报透露,“科恩可能会引入外部投资者,例如中东主权财富基金,为交易背书”。《华尔街日报》还报道称,如果 eBay 不接受其报价,科恩已经准备对公司发起代理权争夺。 🗒 标签: #GameStop#eBay 📢 频道: @GodlyNews1 🤖 投稿: @GodlyNewsBot

Venture Village Wall 🦄

@venturevillagewall · Post #4144 · 13.02.2025 г., 22:00

SEC Accepts Grayscale's DOGE ETF Application The U.S. SEC has accepted Grayscale and NYSE's 19b-4 application for a DOGE ETF. This marks a significant step in the integration of Dogecoin into mainstream finance. Read more. In other news, GameStop is considering an investment in Bitcoin and other cryptocurrencies while evaluating alignment with its business strategy. More details can be found here. Coinbase reports over a 130% revenue surge, reaching $2.3 billion for Q4, exceeding expectations. Full report reveals strong market performance. Additionally, Frodobots successfully raised $6M for a Solana-based robotics network. Learn more. #DOGE#ETF#GameStop#Bitcoin#Crypto#Coinbase#Revenue#Solana#DeFi#AI # VC

Venture Village Wall 🦄

@venturevillagewall · Post #4147 · 14.02.2025 г., 07:00

Bitcoin and Ethereum ETF Trends BTC ETF saw $157M outflow; ETH ETF gained $13M inflow. In 24 hours, 94K traders liquidated, totaling $169M, with the largest being $1.3M on Bybit for BTC/USDT. Notably, 4,135 #BTC ($399.8M) moved from #Coincheck to an unknown wallet. Gamestop plans to invest $4.6B in Bitcoin, raising its stock prices. Meanwhile, 1723HK shares surged 631% this year, naming new directors with Bitcoin ecosystem expertise. #BTC#ETH#ETF#Crypto#Gamestop#Coincheck#WhaleAlert#HongKong#Investment#StockMarket#Trading#Liquidation#MarketTrends#Blockchain#Finance#Innovation#Directors#Performance#News#AI#VC

Venture Village Wall 🦄

@venturevillagewall · Post #4245 · 25.02.2025 г., 22:00

ETH Deposits Surge on Bybit Aave's ETH supply surpassed 2M for the first time. Mirana Ventures deposited $600M worth of ETH into Bybit, becoming the largest depositor since the hack. The firm sold $500M in Bitcoin and $100M in USDT to fund this. In addition, $130M in USDT transferred to Tether Treasury. Significant BTC movements reported as well. Full details in the links: Arkham, The Block, Whale Alert USDT Transfer. #ETH#Aave#Bybit#Crypto#USDT#BTC#MiranaVentures#DeFi#Arkham#Treasury#GameStop#SEC#Uniswap#AlgorithmicTrading#Blockchain#Investments#Bitcoin#WhaleAlert#Fintech#VC

Venture Village Wall 🦄

@venturevillagewall · Post #3956 · 23.01.2025 г., 04:00

Roaring Kitty Hints at Comeback 🐦 Roaring Kitty, a key figure in the GameStop stock surge, teases a return. His recent tweet features a video, sparking nostalgia and speculation about upcoming moves. Kitty symbolizes retail investor resistance against Wall Street, igniting the meme stock revolution in 2021. 🔗Roaring Kitty's tweet 🔗 Whale Alert: $102M in #BTC transferred Details here 🔗 Bithumb launches new ARDR & QKC trading Read more #GameStop#RoaringKitty#memeStocks#BTC#Crypto#VC#RetailInvestors#WhaleAlert#SouthKorea#Trading#Bithumb#ARDR#QKC#Investing#MarketNews#Finance#Nostalgia#Tease#Speculation