Package: matrix-47
matrix__      _
  __ _  ___ _/ /_____(_)_ __
 /  ' \/ _ `/ __/ __/ /\ \ /
/_/_/_/\_,_/\__/_/ /_//_\_\A python package for matrix operations and manipulations.ContentsBack-StoryFeaturesInstallationUsageUninstallationContributingBack-StoryI had just completed my "Journey through the Docs", studying the Core Python aspect of the Python Docs (majorly the Library & Language References, wherever else those referred me to and whatever else I needed to fully understand things) with interactive sessions, testing things out and making notes.Then I needed something to put to (real) practice all the things I had learned.
I wanted something purelyStandardPython, no 3rd-party libraries and seemed this project would be a good place to start.The project was actually concieved in the course of my "Journey through the Docs" but only stayed on my TODO list till after.It's been interesting so far and the project actually turned out to incoparate a lot of what I learned... though, definitely not all. :smile:NOTE:This project is not intended to be a "re-invention of any wheel", it's just me practicing.
I actually didn't test out or go through any similar project in the course of developing this.FeaturesThis is just an outline of the major features of the library. For the complete feature list, detailed descriptions and project documentation, see thedocumentation.Matrix initialization. Via:The class constructorUtility functions to generate:Unit matrices.Matrices filled with random integer elements.Matrices filled with random floating-point elements.Matrix object interactionsIntelligent string representationSubscriptionSingle-element indexing, assignment and deletionBlock-slice (sub-matrix) subscription and assignment.TruthinessMembership test for elementsIteration over elementsPer-element roundingMatrix object propertiesSizeNumber of rowsNumber of columnsDeterminantPrincipal diagonalTraceRankMatrix OperationsNegationEquality comparisonAddition and subtractionScalar multiplicationMatrix multiplicationExponentiation (Repeated matrix multiplication)Division (by scalar)InverseTransposeAugmentationRow reductionRow Echelon form (Forward elimination)Reduced Row Echelon formBack substitutionTests for matrix properties and special matricesDiagonalityNullityOrthogonalitySquarenessSymmetryTriangularityIdentity matrixConformabilityMatrix viewsThese are views of the matrix object, like.keys()and.values()are todict.Rows and Columns (and their slices). Support:Single row/column IndexingSlicing of multiple rows/columns (Yes, a slice of rows/columns can still be sliced further! :sunglasses:)Row/column assignment and deletion (Rows/Columns slicesDO NOTsupport these).Length (number of rows/columns "in" the view)Iteration over rows/columnsRow and column. Support:String representationSingle element indexingMultiple element slicingEquality comparisonMathematical operations (Also supports augmented assignment of these operations):Addition and subtraction of rows and/or columns (Element-wise)Multiplication and Division by scalarMultiplication and Division by row/column (i.e inter-operation of two rows/columns element-by-element)NOTE:Augmented assignments of these operations are performedin-placei.e affect the matrix itself.Row/column lengthMembership testsIteration over elementsOther operations on matricesHorizontal and vertical flipClockwise and anti-clockwise rotationMatrix copyMatrix resizeRounded comparisonSolutions to systems of linear equationsGaussian eliminationGauss-Jordan eliminationInverse methodInstallationRequirementsPython >= 3.8Install from PYPINOTE: You must have thepippython package installed (usually is, by default)Runpipinstallmatrix-47ORpython-mpipinstallmatrix-47Install from sourceDownload and unzipthis repositoryor rungitclonehttps://github.com/AnonymouX47/matrixChange your Working Directory to the local repository; runcdmatrixThen, runpipinstall.ORpythonsetup.pyinstallto install the package.Instead, you might runpython-itest.pyto just test out the library without installing the package (but will be limited to only that interactive session).NOTE:On Windows, the Python executables must've been added toPATH(For help, checkhere).UsageQuick example:>>>frommatriximportMatrix>>>print(Matrix(4,4))+―――――――――――――――+|0|0|0|0||―――+―――+―――+―――||0|0|0|0||―――+―――+―――+―――||0|0|0|0||―――+―――+―――+―――||0|0|0|0|+―――――――――――――――+For more usage examples, check thesamples.For the complete feature list and descriptions, seeFeature Description.UninstallationTo uninstall the package, runpipuninstallmatrixContributingIf you find any bug, please create anIssuein theIssues section.
Please make sure you check other issues first, to make sure you don't create a duplicate. Thank you :smile: