@ai_match_prediction · Post #11630 · 20.04.2026 г., 13:05
England Premier League🏴 2026-04-20 19:00 UTC Crystal Palace vs. West Ham Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #CrystalPalace#WestHam #Football#PremierLeague
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
Пребарај: #westham
@ai_match_prediction · Post #11630 · 20.04.2026 г., 13:05
England Premier League🏴 2026-04-20 19:00 UTC Crystal Palace vs. West Ham Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 0:0 #CrystalPalace#WestHam #Football#PremierLeague
@ai_match_prediction · Post #11403 · 10.04.2026 г., 13:05
England Premier League🏴 2026-04-10 19:00 UTC West Ham vs. Wolves Predicted outcome: West Ham✅ Predicted score: 1:0 Actual: West Ham 4:0 #WestHam#Wolves #Football#PremierLeague
@ai_match_prediction · Post #11142 · 22.03.2026 г., 05:05
England Premier League🏴 2026-03-22 12:00 UTC Newcastle vs. Sunderland Predicted outcome: Newcastle❌ Predicted score: 2:1 Actual: Sunderland 1:2 #Newcastle#Sunderland 2026-03-22 14:15 UTC Tottenham vs. Nottingham Forest Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Nottingham Forest 0:3 #Tottenham#NottinghamForest 2026-03-22 14:15 UTC Aston Villa vs. West Ham Predicted outcome: Aston Villa✅ Predicted score: 2:1 Actual: Aston Villa 2:0 #AstonVilla#WestHam #Football#PremierLeague
@ai_match_prediction · Post #12008 · 10.05.2026 г., 05:05
England Premier League🏴 2026-05-10 13:00 UTC Burnley vs. Aston Villa Predicted outcome: Aston Villa❌ Predicted score: 1:2 Actual: Draw 2:2 #Burnley#AstonVilla 2026-05-10 13:00 UTC Crystal Palace vs. Everton Predicted outcome: Everton❌ Predicted score: 1:2 Actual: Draw 2:2 #CrystalPalace#Everton 2026-05-10 13:00 UTC Nottingham Forest vs. Newcastle Predicted outcome: Nottingham Forest❌ Predicted score: 2:1 Actual: Draw 1:1 #NottinghamForest#Newcastle 2026-05-10 15:30 UTC West Ham vs. Arsenal Predicted outcome: Arsenal✅ Predicted score: 1:2 Actual: Arsenal 0:1 #WestHam#Arsenal #Football#PremierLeague
@ai_match_prediction · Post #11853 · 02.05.2026 г., 09:05
England Premier League🏴 2026-05-02 14:00 UTC Newcastle vs. Brighton Predicted outcome: Brighton❌ Predicted score: 1:2 Actual: Newcastle 3:1 #Newcastle#Brighton 2026-05-02 14:00 UTC Wolves vs. Sunderland Predicted outcome: Sunderland❌ Predicted score: 1:2 Actual: Draw 1:1 #Wolves#Sunderland 2026-05-02 14:00 UTC Brentford vs. West Ham Predicted outcome: Brentford✅ Predicted score: 2:1 Actual: Brentford 3:0 #Brentford#WestHam 2026-05-02 16:30 UTC Arsenal vs. Fulham Predicted outcome: Arsenal✅ Predicted score: 2:1 Actual: Arsenal 3:0 #Arsenal#Fulham #Football#PremierLeague
@ai_match_prediction · Post #11719 · 25.04.2026 г., 05:05
England Premier League🏴 2026-04-25 11:30 UTC Fulham vs. Aston Villa Predicted outcome: Fulham✅ Predicted score: 2:1 Actual: Fulham 1:0 #Fulham#AstonVilla 2026-04-25 14:00 UTC Wolves vs. Tottenham Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Tottenham 0:1 #Wolves#Tottenham 2026-04-25 14:00 UTC Liverpool vs. Crystal Palace Predicted outcome: Liverpool✅ Predicted score: 2:1 Actual: Liverpool 3:1 #Liverpool#CrystalPalace 2026-04-25 14:00 UTC West Ham vs. Everton Predicted outcome: Draw❌ Predicted score: 1:1 Actual: West Ham 2:1 #WestHam#Everton 2026-04-25 16:30 UTC Arsenal vs. Newcastle Predicted outcome: Arsenal✅ Predicted score: 2:1 Actual: Arsenal 1:0 #Arsenal#Newcastle #Football#PremierLeague