\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Bromine} \pdfinfo{ /Title (python-math-in-rus.pdf) /Creator (Cheatography) /Author (Bromine) /Subject (Python math (in Rus) Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{BDBDBD} \definecolor{LightBackground}{HTML}{F6F6F6} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Python math (in Rus) Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Bromine} via \textcolor{DarkBackground}{\uline{cheatography.com/33505/cs/10440/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Bromine \\ \uline{cheatography.com/bromine} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 6th January, 2017.\\ Updated 6th January, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.18988 cm} x{2.78712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Модуль MATH}} \tn % Row 0 \SetRowColor{LightBackground} `{\bf{ceil}}(x)` & Округление вверх \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\bf{floor}}(x)` & Округление вниз \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\bf{fabs}}(x)` & | x | \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} `{\bf{factorial}}(x)` & x! \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} `{\bf{fsum}}(list)` & Сумма list \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} `{\bf{exp}}(x)` & e\textasciicircum{}x\textasciicircum{} \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} `{\bf{log}}(x,y)` & log(x) по основанию y \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} `{\bf{pow}}(x,y)` & x\textasciicircum{}y\textasciicircum{} \tn % Row Count 12 (+ 1) % Row 8 \SetRowColor{LightBackground} `{\bf{sqrt}}(x)` & Корень из x \tn % Row Count 13 (+ 1) % Row 9 \SetRowColor{white} `{\bf{sin}}` , `{\bf{sinh}}(x)` & sin(x) и asin(x) * \tn % Row Count 15 (+ 2) % Row 10 \SetRowColor{LightBackground} `{\bf{cos}}` , `{\bf{cosh}}(x)` & cos(x) и acos(x) * \tn % Row Count 17 (+ 2) % Row 11 \SetRowColor{white} `{\bf{tan}}` , `{\bf{tanh}}(x)` & tg(x) и atg(x) * \tn % Row Count 19 (+ 2) % Row 12 \SetRowColor{LightBackground} `{\bf{degrees}}(x)` & Радианы в градусы \tn % Row Count 21 (+ 2) % Row 13 \SetRowColor{white} `{\bf{radians}}(x)` & Градусы в радианы \tn % Row Count 23 (+ 2) % Row 14 \SetRowColor{LightBackground} `{\bf{erf}}(x)` & Функция ошибок \tn % Row Count 25 (+ 2) % Row 15 \SetRowColor{white} `{\bf{gamma}}(x)` & Гамма-​ функция \tn % Row Count 27 (+ 2) % Row 16 \SetRowColor{LightBackground} `{\bf{pi}}` , `{\bf{e}}` & Числа {\emph{π}} и {\emph{e}} \tn % Row Count 29 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\textasciicircum{}{\emph{* а так же их обратные функции `{\bf{asin}}(x)`, `{\bf{asinh}}(x)` и т.д.}}\textasciicircum{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.64241 cm} x{3.33459 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Библиотека SCIPY}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{`sp.constants}}` & Константы \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{`sp.cluster}}` & Векторное квантование \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{`sp.fftpack}}` & \seqsplit{Преобразование} Фурье \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{`sp.integrate}}` & \seqsplit{Интегрирование} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{`sp.interpolate}}` & Интерполяция \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{`sp.io}}` & Ввод/вывод данных \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{`sp.linalg}}` & Линейная алгебра \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} {\bf{`sp.misc}}` & Разное \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} {\bf{`sp.optimize}}` & Оптимизация \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} {\bf{`sp.signal}}` & Обработка сигналов \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{`sp.special}}` & Спец. функции \tn % Row Count 21 (+ 2) % Row 11 \SetRowColor{white} {\bf{`sp.stats}}` & Статистика \tn % Row Count 23 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{`sp.wawe}}` & \seqsplit{Использование} кода C/C++ \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\textasciicircum{}{\emph{ sp == scipy}}\textasciicircum{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Библиотека NUMPY}} \tn % Row 0 \SetRowColor{LightBackground} `{\bf{array}}({[}a,b,...{]})` & Массив NumPy \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\bf{array}}({[}{[}{]},{[}{]},...{]})` & Двумерный массив * \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\bf{zeros}}(N)` & Массив нулей \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} `{\bf{ones}}(N)` & Массив единиц \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} `{\bf{eye}}(N)` & Единицы по диагонали \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} `{\bf{empty}}(N)` & Пустой массив \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} `{\bf{linspace}}(a,b,d)` & Диапазон от a до b \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} `A.{\bf{size}}` & Количество элементов \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} `A.{\bf{shape}}` & Размерность \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} `A.{\bf{min/max}}()` & Min и Max ** \tn % Row Count 18 (+ 2) % Row 10 \SetRowColor{LightBackground} `A.{\bf{ravel}}()` & Плоский массив из N \tn % Row Count 20 (+ 2) % Row 11 \SetRowColor{white} `A.{\bf{transpose}}()` & \seqsplit{Транспонирование} \tn % Row Count 22 (+ 2) % Row 12 \SetRowColor{LightBackground} `{\bf{random}}()` & Случайные числа \tn % Row Count 24 (+ 2) % Row 13 \SetRowColor{white} `{\bf{vectorize}}(fun)` & \seqsplit{Векторизация} функции \tn % Row Count 26 (+ 2) % Row 14 \SetRowColor{LightBackground} `{\bf{numpy.linalg}}` & Модуль лин.алгебры \tn % Row Count 28 (+ 2) % Row 15 \SetRowColor{white} `{\bf{lg.matrix\_power}}(A,n)` & Возведение матрицы A в степень \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Библиотека NUMPY (cont)}} \tn % Row 16 \SetRowColor{LightBackground} `{\bf{lg.eig}}(A)` & Cобственные значения и векторы. \tn % Row Count 3 (+ 3) % Row 17 \SetRowColor{white} `{\bf{lg.norm}}(A)` & Норма \tn % Row Count 5 (+ 2) % Row 18 \SetRowColor{LightBackground} `{\bf{lg.det}}(A)` & Детерминант \tn % Row Count 6 (+ 1) % Row 19 \SetRowColor{white} `{\bf{lg.solve}}(A,B)` & Решить систему линейных уравнений A{\emph{x}} = B \tn % Row Count 9 (+ 3) % Row 20 \SetRowColor{LightBackground} `{\bf{lg.lstsq}}(A,B)` & Метод наименьших квадратов \tn % Row Count 12 (+ 3) % Row 21 \SetRowColor{white} `{\bf{lg.inv}}(A)` & Обратная матрица \tn % Row Count 14 (+ 2) % Row 22 \SetRowColor{LightBackground} `{\bf{median}}(A)` & Медиана \tn % Row Count 15 (+ 1) % Row 23 \SetRowColor{white} `{\bf{average}}(A)` & Среднее взвешенное \tn % Row Count 17 (+ 2) % Row 24 \SetRowColor{LightBackground} `{\bf{mean}}(A)` & Среднее \seqsplit{арифметическое} \tn % Row Count 19 (+ 2) % Row 25 \SetRowColor{white} `{\bf{std}}(A)` & Стандартное отклонение \tn % Row Count 21 (+ 2) % Row 26 \SetRowColor{LightBackground} `{\bf{var}}(A)` & Дисперсия \tn % Row Count 22 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\textasciicircum{}{\emph{lg == linalg}}\textasciicircum{} \newline \textasciicircum{}{\emph{* `array{[}x,y{]}` - (строка,столбец); `array{[} x {]}` - (строка); `array{[}:,y{]}` - (столбец); `array{[}a:b{]}` - (от : до) }}\textasciicircum{} \newline \textasciicircum{}{\emph{** (None\textasciitilde{}по всему объему; 0-по строкам; 1-по столбцам)}}\textasciicircum{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.69218 cm} x{3.28482 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Библиотека MATPLOTLIB}} \tn % Row 0 \SetRowColor{LightBackground} `{\bf{mpl.pyplot}}` & Основной модуль \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\bf{pt.figure}}()` & Создать рисунок \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `{\bf{pt.title}}()` & Название \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `{\bf{pt.axis}}()` & Масштаб по осям \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `{\bf{pt.xlabel}}()` & Подпись к оси x \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} `{\bf{pt.setp}}()` & Задать свойства \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} `{\bf{pt.grid}}()` & Сетка (True/False) \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} `{\bf{pt.show}}()` & Показать все рисунки \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} `{\bf{pt.scatter}}()` & Точечное рисование \tn % Row Count 18 (+ 2) % Row 9 \SetRowColor{white} `{\bf{pt.plot}}()` & Ломаная линия \tn % Row Count 20 (+ 2) % Row 10 \SetRowColor{LightBackground} `{\bf{pt.text}}()` & Текст \tn % Row Count 22 (+ 2) % Row 11 \SetRowColor{white} `{\bf{pt.bar}}()` & Столбчатая дтаграмма \tn % Row Count 24 (+ 2) % Row 12 \SetRowColor{LightBackground} `{\bf{ptt.hist}}()` & Гистограмма \tn % Row Count 26 (+ 2) % Row 13 \SetRowColor{white} `{\bf{pt.pie}}()` & Круговая диаграмма \tn % Row Count 28 (+ 2) % Row 14 \SetRowColor{LightBackground} `{\bf{pt.contour}}()` & Изолинии \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.69218 cm} x{3.28482 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Библиотека MATPLOTLIB (cont)}} \tn % Row 15 \SetRowColor{LightBackground} `{\bf{pt.pcolormesh}}()` & \seqsplit{Псевдоцветное} изображение \tn % Row Count 2 (+ 2) % Row 16 \SetRowColor{white} `{\bf{pt.fill}}()` & Заливка \seqsplit{многоугольника} \tn % Row Count 4 (+ 2) % Row 17 \SetRowColor{LightBackground} `{\bf{pt.quiver}}()` & Векторное поле \tn % Row Count 6 (+ 2) % Row 18 \SetRowColor{white} `{\bf{mpl.figure}}` & Модуль рисунка \tn % Row Count 8 (+ 2) % Row 19 \SetRowColor{LightBackground} `{\bf{mpl.artist}}` & Элементы рисунка \tn % Row Count 10 (+ 2) % Row 20 \SetRowColor{white} `{\bf{mpl.subplot}}` & Подрисунок \tn % Row Count 12 (+ 2) % Row 21 \SetRowColor{LightBackground} `{\bf{mpl.axis}}` & Оси \tn % Row Count 14 (+ 2) % Row 22 \SetRowColor{white} `{\bf{mpl.colorbar}}` & Цветная полоса \tn % Row Count 16 (+ 2) % Row 23 \SetRowColor{LightBackground} `{\bf{mpl.text}}` & Текст \tn % Row Count 18 (+ 2) % Row 24 \SetRowColor{white} `{\bf{mpl.legend}}` & Легенда \tn % Row Count 20 (+ 2) % Row 25 \SetRowColor{LightBackground} `{\bf{mpl.axes}}` & Область рисования \tn % Row Count 22 (+ 2) % Row 26 \SetRowColor{white} `{\bf{mpl.ticker}}` & Сетка \tn % Row Count 24 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\textasciicircum{}{\emph{mpl == matplotlib; pt == pyplot}}\textasciicircum{}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{\seqsplit{Дополнительные} библиотеки}} \tn % Row 0 \SetRowColor{LightBackground} `{\bf{sympy}}` & Символьные вычисления \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `{\bf{dislin}}` & 3D-графики \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} `{\bf{chaco}}` & 2D-графики и рисунки \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} `{\bf{scikit.learn}}` & Машинное обучение \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} `{\bf{pandas}}` & Анализ данных \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} `{\bf{mdp}}` & Анализ данных \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}