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 | |
| from datetime import timedelta | |
| 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 requests | |
| import json | |
| import pandas as pd | |
| import datetime | |
| from datetime import timedelta | |
| import locale | |
| import warnings |
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 | |
| from datetime import 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 | |
| # Группировка данных по Объёму и суммирование оборота | |
| grouped_df = df.groupby('Объём')['Оборот'].sum().reset_index() | |
| # Сортировка данных по обороту в порядке убывания | |
| df_sorted = grouped_df.sort_values(by='Оборот', ascending=False) | |
| df_sorted = df_sorted.head(25) |
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 pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from scipy import stats |
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 warnings | |
| warnings.filterwarnings("ignore", category=DeprecationWarning) | |
| import openpyxl | |
| from openpyxl import Workbook | |
| from openpyxl.utils.dataframe import dataframe_to_rows |
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 itertools | |
| import pandas as pd | |
| from scipy.stats import ttest_ind | |
| # Создание списка для хранения результатов | |
| results = [] |
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 | |
| ''' | |
| Если взять и преобразовать данные в нижний регистр текста вот так: df['some_col'].str.lower(), | |
| то если в колонке 'some_col' встретятся строки состоящие только из цифр, функция вернёт NaN. | |
| Чтобы избежать такого результата проходим по всем числам (и только числам) функцией: | |
| ''' | |
| def convert_to_text(value): |
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 matplotlib.pyplot as plt | |
| df = pd.read_excel('some_data.xlsx') | |
| df.info() | |
| # Создаем интервалы по горизонтали? кратность 10 | |
| bins = range(0, int(df['Price'].max()) + 10, 10) |
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() |
OlderNewer