Transposed Matrix

In linear algebra, the transpose of a matrix A is another matrix AT (also written A′, Atr,tA or At) created by any one of the following equivalent actions:

  • reflect A over its main diagonal (which runs from top-left to bottom-right) to obtain AT
  • write the rows of A as the columns of AT
  • write the columns of A as the rows of AT

Formally, the ith row, jth column element of AT is the jth row, ith column element of A:

[AT]i j = [A]j i

If A is an m × n matrix then AT is an n × m matrix.

You have been given a matrix as a 2D list with integers. Your task is to return a transposed matrix based on input.

Input: A matrix as a list of lists with integers.

Output: The transposed matrix as a list of lists with integers.

题目大义: 矩阵转置

 def checkio(data):
rel = []
tmp = zip(*data) for each in tmp:
rel.append(list(each)) #replace this for solution
return rel

使用map函数一行解决

 def checkio(data):
return map(list, zip(*data))

多加练习才能孰能生巧

Transposed Matrix的更多相关文章

  1. 转置卷积Transposed Convolution

    转置卷积Transposed Convolution 我们为卷积神经网络引入的层,包括卷积层和池层,通常会减小输入的宽度和高度,或者保持不变.然而,语义分割和生成对抗网络等应用程序需要预测每个像素的值 ...

  2. 顶点着色器详解 (Vertex Shaders)

    学习了顶点处理,你就知道固定功能流水线怎么将顶点从模型空间坐标系统转化到屏幕空间坐标系统.虽然固定功能流水线也可以通过设置渲染状态和参数来改变最终输出的结果,但是它的整体功能还是受限.当我们想实现一个 ...

  3. RTKLIB源码解析(一)——单点定位(pntpos.c)

    RTKLIB源码解析(一)--单点定位(pntpos.c) 标签: GNSS RTKLIB 单点定位 [TOC] pntpos int pntpos (const obsd_t *obs, int n ...

  4. opencv基础笔记(1)

    为了细致掌握程明明CVPR 2014 oral文章:BING: Binarized Normed Gradients for Objectness Estimation at 300fps的代码,的好 ...

  5. latex算法步骤如何去掉序号

    想去掉latex算法步骤前面的序号,如下 我想去掉每个算法步骤前面的数字序号,1,2,3,因为我已经写了step.我们只需要引用a lgorithmic这个包就可以了,代码如下: \usepackag ...

  6. 【UE4 C++】UKismetMathLibrary 源代码

    // Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" # ...

  7. C++_Eigen函数库用法笔记——Matrix and Vector Arithmetic

    Addition and subtraction Scalar multiplication and division Transposition Matrix-matrix and matrix-v ...

  8. [Python] 01 - Number and Matrix

    故事背景 一.大纲 如下,chapter4 是个概览,之后才是具体讲解. 二. 编译过程 Ref: http://www.dsf.unica.it/~fiore/LearningPython.pdf

  9. angular2系列教程(十一)路由嵌套、路由生命周期、matrix URL notation

    今天我们要讲的是ng2的路由的第二部分,包括路由嵌套.路由生命周期等知识点. 例子 例子仍然是上节课的例子:

随机推荐

  1. java.lang.NoClassDefFoundError 异常

    在项目实施过程中,当访问某一个功能时,出现异常为  java.lang.NoClassDefFoundError  com/xxx/yyy/Zzzz > ,检查发现这个类实际已经存在于应用服务器 ...

  2. (转)Iphone数组一些基础操作 NSArray/NSMutableArray

    /******************************************************************************************* NSArray ...

  3. Java 高效 MVC & REST 开发框架 JessMA v3.2.1 即将发布

        JessMA(原名:Portal-Basic)是一套功能完备的高性能 Full-Stack Web 应用开发框架,内置可扩展的 MVC Web 基础架构和 DAO 数据库访问组件(内部已提供了 ...

  4. Java清洁:终结处理和垃圾回收

    一般情况:Java有垃圾回收机制负责回收无用对象占据的内存资源. 特殊情况:假定你的对象(并非使用new)获得一块特殊的内存区域,由于垃圾回收器只知道释放那些经由new分配的内存,所以它不知道如何释放 ...

  5. CSS 实现三角形、梯形、等腰梯形

    三角形 ; width: 0px; border-width: 0px 30px 45px 145px; border-style: none solid solid; border-color: t ...

  6. 未能加载文件或程序集 system.data.sqlite 完美解决

    错误提示如下图所示: 解决办法: 使用SQLITE 预编译的静态链接DLL 下载地址:http://pan.baidu.com/s/1kT5i8bP

  7. AngularJs练习Demo3

    @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport&quo ...

  8. Objective-C 协议(接口)

    Objective-C 协议类似于java语言中的接口 新建文件步骤:Objective-C File ---> File Type = "Protocol" @protoc ...

  9. java下的第一个redis

    Redis支持很多编程语言的客户端,有C.C#.C++.Clojure.Common Lisp.Erlang.Go.Lua.Objective-C.PHP.Ruby.Scala,甚至更时髦的Node. ...

  10. String.equals()

    名称                                               说明 String.Equals(Obejecct)            确定String实例是否指 ...