Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления.
from __future__ import division
Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда.
Например:
int/int => int
int/float => float
В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float.
Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float.
12/float(5) => float
Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//".
>>> 3/2
1.5
>>> 3//2
1
То есть теперь деление int на int даёт float если результат не целое число.
В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами.
Данный переход описан в PEP238.
#pep#2to3#basic
🇨🇳 La Chine a procédé au lancement réussi du satellite expérimental Shiyan‑33 qui sera principalement utilisé pour l’étude de l’environnement spatial, a rapporté l’agence Xinhua.
#chine#satellite#lancement
🌍 In 1972, the first Landsat satellite began photographing Earth's surface from space, fueling a new era of digital mapping and revealing real-time changes in forests, cities, and coastlines. ✨
#cartography⚡#satellite⚡#mapping⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The deepest parts of the Amazon rainforest were first mapped by satellite only in the 21st century. Modern exploration now reveals hidden rivers and lost cities from space in this vast green wilderness. ✨
#exploration⚡#rainforest⚡#satellite⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Space-based radar now tracks land subsiding from groundwater loss, revealing areas sinking by centimeters each year. These invisible changes help pinpoint regions at risk of flooding and damage. ✨
#remote⚡#sensing⚡#satellite⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
https://github.com/daleroberts/tv
tv ("#textview") is a small tool to quickly view high-resolution multi-band imagery directly in your terminal. It was designed for working with (very large) #satellite imagery data over a low-bandwidth connection. For example, you can directly visualise a Himawari 8 (11K x 11K pixel) image of the Earth directly from its URL:
It is built upon the wonderful #GDAL library so it is able to load a large variety of image formats (GeoTiff, PNG, Jpeg, NetCDF, ...) and subsample the image as it reads from disk so it can handle very large files quickly. It has the ability to read filenames (or URLs) from stdin and load files directly from URLs without writing locally to disk. Command line options are styled after gdal_translate such as:
-b to specify the bands (and ordering) to use,
-srcwin xoff yoff xsize ysize to view a subset of the image,
-r to specify the subsampling algorithm (nearest, bilinear, cubic, cubicspline, lanczos, average, mode).
$450K Fundraise for Bifrost Connect
OrbitalNerds has raised $450K for its innovative satellite SSH service, Bifrost Connect, on December 4, 2024. For more details, visit OrbitalNerds.
#Funding#Satellite#SSH#BifrostConnect#OrbitalNerds
Myriota Secures $50M Funding
Myriota has successfully raised $50 million in funding for its direct-to-orbit satellite connectivity solutions aimed at the Internet of Things. This funding round took place on December 19, 2024. For more details, visit Myriota.
#Myriota#Funding#Satellite#IoT#Connectivity#SpaceTech#DirectToOrbit#Investment#TechNews#Telecommunications