This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| # Библиотеки | |
| import requests | |
| import json | |
| import time | |
| import pandas as pd | |
| import datetime | |
| import locale |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| import scipy.stats as stats | |
| # Тестовые списки баллов для каждой группы | |
| metal = [85, 88, 82, 90, 87] | |
| jazz = [72, 78, 68, 80, 75] | |
| classic = [91, 85, 89, 95, 92] | |
| rap = [79, 83, 76, 85, 80] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| ''' | |
| Тест Шапиро-Уилка на нормальность распределения | |
| ''' | |
| # H0 - данные распределены нормально | |
| # H1 - данные не распределены нормально | |
| from scipy.stats import shapiro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| ''' | |
| Допустим у вас есть несколько однотипных файлов с данными по продажам с маркетплейса Ozon. | |
| Для того чтобы вытащить из них информацию для обработки сначала необходимо загрузить всё это в датафрейм. | |
| Можно поступить двумя способами: использую библиотеку glob или библиотеку os. Все ваши файлы складываем в какую-нибудь папку, | |
| там же где будет лежать скрипт python. Папку назовём 'Ozon_FBO'. Затем пишем код… | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| '''Бывает такое, что копируешь файл с уже написанным кодом из Jupyter Notebook | |
| в новый проект прям всем файлом целиком, вносишь правки, запускаешь. | |
| И если в коде есть сохранение файлов, то может произойти такое, | |
| когда файлы сохраняются не в новой директории скрипта, | |
| а в старой. Чтобы всё это починить нужно написать следующий код в ноутбуке: | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| # Замечательная библиотека для построения интерактивных графиков с продажами и скользящим средним сразу для всех артикулов | |
| ''' | |
| Дано: | |
| new_df - датафрейм | |
| art - артикулы товаров | |
| date_order - даты продажи |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| # Если данных мало для построения полноценной предсказательной модели, | |
| # то можно посчитать спрос за последний значимый период | |
| # и спрогнозировать потребность товаров на складе | |
| # Для этого выгружаем данные по FBO и FBS из кабинета Ozon в разделе «Заказы со склада Ozon» и «Заказы с моих складов» | |
| # в формате аналитических данных CSV. Далее пишем код: | |
| # Импортируем нужные библиотеки |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| # Выгрузка всей информации о рекламных кампаниях в Wildberries через API: https://advert-api.wildberries.ru/adv/v2/fullstats | |
| # Возвращает статистику кампаний. Максимум 1 запрос в минуту :( Данные вернутся для кампаний в статусе 7, 9 и 11. | |
| def adv_wb_info(list_campaign, d_start, d_end): | |
| request_data = pd.DataFrame() | |
| for index, row in list_campaign.iterrows(): | |
| id_campaign = row['advertId'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| # Продажи на Ozon в графике | |
| import pandas as pd | |
| import numpy as np | |
| import locale | |
| import os | |
| import csv | |
| from datetime import datetime, timedelta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Developed by MikyPo | |
| # More code for DA here: https://dzen.ru/mikypo | |
| import pandas as pd | |
| import numpy as np | |
| import plotly.express as px | |
| import plotly.colors.qualitative | |
| # Создаем пустой DataFrame для сбора данных по всем направлениям | |
| final_df = pd.DataFrame() |