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

TGINSIGHT SIMILAR POSTS

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

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

Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic

Hashtags

Резултати

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

Пребарај: #thoughtspot

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

@datasciencejobs · Post #2076 · 07.05.2024 г., 17:05

#DataEngineer#ContractPosition#Remote # GCP #ThoughtSpot#BigData#Affinity#Slack#Looker#Snowflake Разыскиваем #DataEngineer на работу по контракту с крупной американской венчурной компанией. Контракт на 6 месяцев с возможностью перезаключения договора. Предпочтительна возможность работать в их часовых поясах, но возможны варианты. Стек технологий: GCP, ETL, Snowflake, CRM Affinity, SQL, Airflow, ThoughtSpot (preferred) or Looker , Python, SQL (нужен full stack!) Английский B2 и выше – условие обязательное. Работать за пределами России и Беларуси - условие обязательное. Зарплата $5000 – 6500 NET Для самых внимательных, кто действительно читает описание вакансии: просим откликаться в том случае, если у вас есть полный стек и присылать резюме в формате Word. Для связи: https://t.me/Tary_bird Description of the Data Engineer contract position: Location: Preferably San Francisco Bay Area, or remotely in the Pacific or Central Time zone. Company: A large venture company with assets of over $11 billion and employees in Austin, London, Menlo Park, and San Francisco. What to expect: Your role as a data engineer involves reporting to the head of the data and analytics department and participating in the creation of the entire structure and infrastructure necessary to support operations. Responsibilities: Developing, creating, and maintaining data infrastructure for optimal extraction, transformation, and loading of data from various sources using SQL, NoSQL, and big data technologies. Creating and implementing data collection systems that integrate various sources, including company proprietary data and external sources. Automating the process of collecting and visualizing user engagement data from CRM/UI. Developing and supporting ETL (Extract, Transform, Load) processes on the Google Cloud platform and in the Snowflake system for efficient data processing. Extracting data from the Affinity CRM system, ensuring its correctness and relevance. Integrating notifications into Slack to improve communication within the team. If necessary, developing and supporting analytical reports and dashboards in BI tools such as ThoughtSpot (preferred) or Looker to make data-driven decisions. What we are looking for: Qualifications: • Experience of at least 3 years as a data engineer or full stack in the field of data warehousing, data monitoring, and building and maintaining ETL pipelines, including experience with Google Cloud and Snowflake. • Deep experience with data pipeline and workflow management tools (Airflow). • Strong proficiency in SQL and Python • Experience with BigQuery. • experience extracting data out of Affinity CRM and integrate notifications back to Slack • Solid knowledge and experience with database design, setup, and maintenance. • Proven ability to work in highly dynamic environments with high product velocity • Strong communication skills, both orally and in writing. Nice to have: • BI tool experience on ThoughtSpot (preferred) or Looker • Bachelor's or master's degree in computer science, database management, etc. For those who pay close attention and thoroughly read through job descriptions: please only apply if you possess full-stack capabilities and send your resume in Word format.

Data Science Jobs

@datasciencejobs · Post #2144 · 07.06.2024 г., 06:02

#DataEngineer#ContractPosition#Remote#GCP#ThoughtSpot#BigData#Affinity#Slack#Looker#Snowflake Разыскивается DataEngineer на работу по контракту с крупной американской венчурной компанией. Контракт на 6 месяцев с возможностью перезаключения договора. Предпочтительна возможность работать в их часовых поясах, но возможны варианты. Стек технологий: GCP, ETL, Snowflake, CRM Affinity, SQL, Airflow, ThoughtSpot (preferred) or Looker , Python, SQL (нужен full stack!!!) Английский B2 и выше – условие обязательное. Работать за пределами России и Беларуси - условие обязательное. Зарплата $5000 – 6500 NET Для самых внимательных, кто действительно читает описание вакансии: просим - откликаться только в том случае, если у вас есть полный стек, - присылать резюме в формате Word. Для связи: https://t.me/Tary_bird Description of the Data Engineer contract position: Location: Preferably San Francisco Bay Area, or remotely in the Pacific or Central Time zone. Company: A large venture company with assets of over $11 billion and employees in Austin, London, Menlo Park, and San Francisco. What to expect: Your role as a data engineer involves reporting to the head of the data and analytics department and participating in the creation of the entire structure and infrastructure necessary to support operations. Responsibilities: Developing, creating, and maintaining data infrastructure for optimal extraction, transformation, and loading of data from various sources using SQL, NoSQL, and big data technologies. Creating and implementing data collection systems that integrate various sources, including company proprietary data and external sources. Automating the process of collecting and visualizing user engagement data from CRM/UI. Developing and supporting ETL (Extract, Transform, Load) processes on the Google Cloud platform and in the Snowflake system for efficient data processing. Extracting data from the Affinity CRM system, ensuring its correctness and relevance. Integrating notifications into Slack to improve communication within the team. If necessary, developing and supporting analytical reports and dashboards in BI tools such as ThoughtSpot (preferred) or Looker to make data-driven decisions. What we are looking for: Qualifications: • Experience of at least 3 years as a data engineer or full stack in the field of data warehousing, data monitoring, and building and maintaining ETL pipelines, including experience with Google Cloud and Snowflake. • Deep experience with data pipeline and workflow management tools (Airflow). • Strong proficiency in SQL and Python • Experience with BigQuery. • experience extracting data out of Affinity CRM and integrate notifications back to Slack • Solid knowledge and experience with database design, setup, and maintenance. • Proven ability to work in highly dynamic environments with high product velocity • Strong communication skills, both orally and in writing.• BI tool experience on ThoughtSpot (preferred) or Looker Nice to have: • Bachelor's or master's degree in computer science, database management, etc.