[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-389903-105":59,"doc-detail-389903-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","python-for-data-science-cheat-sheet-scipy-linear-algebra","Python For Data Science Cheat Sheet - SciPy Linear Algebra","","Python for Data Science Cheat Sheet compiles practical SciPy linear algebra references and NumPy-based array operations for scientific computing. It covers core topics such as dense and sparse matrices, basic matrix routines (inverse, transpose, conjugate transpose, trace, norms, rank, determinant), and solving linear systems including least-squares and pseudo-inverses. The sheet also summarizes array shape manipulation, index tricks, vectorization, type handling, and common polynomial and other utility functions with concise code snippets.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/python-for-data-science-cheat-sheet-scipy-linear-algebra/389903/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/python-for-data-science-cheat-sheet-scipy-linear-algebra/389903.png","ImageObject",300,407,{"name":92,"@type":93},"404brain","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-10-17","2026-09-25",true,{"@type":102,"interactionType":103,"userInteractionCount":44},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What SciPy components are used for linear algebra in this cheat sheet?","Question",{"text":112,"@type":113},"It highlights using SciPy’s linalg and sparse modules, noting that scipy.linalg builds on NumPy’s linalg capabilities.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Which basic matrix operations are listed under basic matrix routines?",{"text":117,"@type":113},"The document lists inverse, transpose, conjugate transpose, trace, several norm types (Frobenius, L1, L-infinity), rank, determinant, and solvers like solve and lstsq.",{"name":119,"@type":110,"acceptedAnswer":120},"How does the cheat sheet handle sparse matrices?",{"text":121,"@type":113},"It shows creating sparse matrices (e.g., CSR/CSC/CSC-like representations) and provides sparse routines such as sparse.linalg.inv, sparse.linalg.norm, and sparse.linalg.spsolve, plus sparse matrix exponential via sparse.linalg.expm.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},389903,1790461365,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":44,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":44,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144},1099529839291,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","Python For Data Science Cheat Sheet  \nSciPy-Linear Algebra  \nLearn More Python for Data Science [Interactively](Interactively at www.datacamp.com)[ at ](Interactively at www.datacamp.com)[www.datacamp.com](Interactively at www.datacamp.com)  \nSciPy  \nThe SciPy library is one of the core packages for scientific computing that provides mathematical algorithms and convenience functions built on the NumPy extension of Python.  \nInteracting With NumPy  Also see NumPy   \n>>> import numpy as np >>> a = np .array([1,2,3])  \n>>> b = np .array([(1+5j,2j,3j), (4j,5j,6j)])  \n>>> c = np .array([[(1 .5,2,3), (4,5,6)], [(3,2,1), (4,5,6)]])  \nIndex Tricks  \n\n| >>> np.mgrid[0:5,0:5]\u003Cbr>>>> np .ogrid[0:2,0:2]>>> np .r_ [[3,[0]*5,-1:1:10j]>>> np .c_ [b,c] | Create a dense meshgrid Create an open meshgrid Stack arrays vertically (row-wise)\u003Cbr>Create stacked column-wise arrays |\n| --- | --- |\n\nShape Manipulation  \n\n| >>> np .transpose(b)\u003Cbr>>>> b .flatten()\u003Cbr>>>> np.hstack((b,c))\u003Cbr>>>> np.vstack((a,b))\u003Cbr>>>> np.hsplit(c,2)\u003Cbr>>>> np.vpslit(d,2) | Permute array dimensions\u003Cbr>Flatten the array\u003Cbr>Stack arrays horizontally (column-wise) Stack arrays vertically (row-wise)\u003Cbr>Split the array horizontally at the 2nd index Split the array vertically at the 2nd index |\n| --- | --- |\n\nPolynomials  \n\n| >>> from numpy import poly1d >>> p = poly1d([3,4,5]) | Create a polynomial object |\n| --- | --- |\n\nVectorizing Functions  \n\n| >>> def myfunc(a):\u003Cbr>if a \u003C 0:\u003Cbr>return a*2\u003Cbr>else:\u003Cbr>return a/2\u003Cbr>>>> np.vectorize(myfunc) | Vectorize functions |\n| --- | --- |\n\nType Handling  \n\n| >>> np .real(c)\u003Cbr>>>> np .imag(c)\u003Cbr>>>> np .real_if_close(c,tol=1000)\u003Cbr>>>> np .cast[ 'f' ](np.pi) | Return the real part of the array elements\u003Cbr>Return the imaginary part of the array elements Return a real array if complex parts close to 0 Cast object to a data type |\n| --- | --- |\n\nOther Useful Functions  \n\n| >>> np .angle(b,deg=True )\u003Cbr>>>> g = np.linspace(0,np.pi,num=5)>>> g [3:] += np.pi >>> np.unwrap(g)\u003Cbr>>>> np .logspace(0,10,3)\u003Cbr>>>> [np.select](np.select) ([c\u003C4],[c*2])\u003Cbr>>>> misc .factorial(a)\u003Cbr>>>> misc .comb(10,3,exact=True )>>> misc.central_diff_weights(3)>>> misc.derivative(myfunc,1.0) | Return the angle of the complex argument Create an array of evenly spaced values (number of samples)\u003Cbr>Unwrap\u003Cbr>Create an array of evenly spaced values (log scale) Return values from a list of arrays depending on conditions\u003Cbr>Factorial\u003Cbr>Combine N things taken at k time\u003Cbr>Weights for Np-point central derivative Find the n-th derivative of a function at a point |\n| --- | --- |\n\nLinear Algebra  Also see NumPy    \nYou’ll use the linalg and sparse modules. Note that scipy .linalg contains and expands on numpy .linalg.  \n>>> from scipy import linalg, sparse  \nCreating Matrices  \n>>> A = np .matrix(np .random .random((2,2)))>>> B = np .asmatrix(b)  \n>>> C = np .mat(np .random .random((10,5)))>>> D = np .mat([[3,4], [5,6]])  \nBasic Matrix Routines  \n\n| Inverse\u003Cbr>>>> A .I\u003Cbr>>>> linalg .inv(A)\u003Cbr>>>> A .T\u003Cbr>>>> A .H\u003Cbr>>>> np .trace(A)\u003Cbr>Norm\u003Cbr>>>> linalg.norm(A)\u003Cbr>>>> linalg.norm(A,1)\u003Cbr>>>> linalg .norm(A,np .inf)\u003Cbr>Rank\u003Cbr>>>> np .linalg .matrix_rank(C)\u003Cbr>Determinant\u003Cbr>>>> linalg.det(A)\u003Cbr>Solving linear problems\u003Cbr>>>> linalg .solve(A,b)>>> E = np.mat(a) .T >>> linalg .lstsq(D,E)\u003Cbr>Generalized inverse\u003Cbr>>>> linalg.pinv(C)\u003Cbr>>>> linalg.pinv2(C) | Inverse\u003Cbr>Inverse\u003Cbr>Tranpose matrix Conjugate transposition Trace\u003Cbr>Frobenius norm\u003Cbr>L1 norm (max column sum)\u003Cbr>L inf norm (max row sum)\u003Cbr>Matrix rank Determinant\u003Cbr>Solver for dense matrices\u003Cbr>Solver for dense matrices\u003Cbr>Least-squares solution to linear matrix equation\u003Cbr>Compute the pseudo-inverse of a matrix (least-squares solver)\u003Cbr>Compute the pseudo-inverse of a matrix (SVD) |\n| --- | --- |\n\nCreating Sparse Matrices  \n\n| >>> F = np .eye(3, k=1)\u003Cbr>>>> G = np .mat(np .identity(2))>>> C[C > 0 .5] = 0\u003Cbr>>>> H = sparse .csr_matrix(C)>>> [I = sparse.csc_matrix](I = sparse.csc_matrix) (D)>>> J = sparse .dok_matri","cbCaihFanChUKjFN","https://ap.wps.com/l/cbCaihFanChUKjFN","pdf",1497850,"English","# SciPy Linear Algebra\n## Array and NumPy Utilities\n## Linear Algebra Fundamentals\n## Sparse Matrices and Sparse Routines\n## Matrix Functions and Decompositions","[{\"question\":\"What SciPy components are used for linear algebra in this cheat sheet?\",\"answer\":\"It highlights using SciPy’s linalg and sparse modules, noting that scipy.linalg builds on NumPy’s linalg capabilities.\"},{\"question\":\"Which basic matrix operations are listed under basic matrix routines?\",\"answer\":\"The document lists inverse, transpose, conjugate transpose, trace, several norm types (Frobenius, L1, L-infinity), rank, determinant, and solvers like solve and lstsq.\"},{\"question\":\"How does the cheat sheet handle sparse matrices?\",\"answer\":\"It shows creating sparse matrices (e.g., CSR/CSC/CSC-like representations) and provides sparse routines such as sparse.linalg.inv, sparse.linalg.norm, and sparse.linalg.spsolve, plus sparse matrix exponential via sparse.linalg.expm.\"}]","Python For Data Science Cheat Sheet - SciPy Linear Algebra | PDF",1790328319,23]