np.mat()和np.transpose
例子:
import numpy as np
dataSet = []
with open('/home/lai/下载/20081023025304.plt') as fr:
for line in fr.readlines()[6:]:
curline = line.strip().split(',')#字符串方法strip():返回去除两侧(不包括)内部空格的字符串;字符串方法spilt:按照制定的字符将字符串分割成序列
fltline = curline[0:2]
fltline = list(map(float, fltline))#list函数将其他类型的序列转换成字符串;map函数将序列curline中的每个元素都转为浮点型
dataSet.append(fltline) a = np.mat(dataSet)
a1 = a.transpose()
print(dataSet)
print('a',a)
print('a1',a1)
结果:
[[39.984702, 116.318417], [39.984683, 116.31845], [39.984686, 116.318417], [39.984688, 116.318385], [39.984655, 116.318263], [39.984611, 116.318026], [39.984608, 116.317761], [39.984563, 116.317517], [39.984539, 116.317294], [39.984606, 116.317065], [39.984568, 116.316911], [39.984586, 116.316716], [39.984561, 116.316527], [39.984536, 116.316354], [39.984523, 116.316188], [39.984516, 116.315963], [39.984523, 116.315823], [39.984574, 116.315611], [39.984568, 116.315407], [39.984538, 116.315148], [39.984501, 116.314907], [39.984532, 116.314808], [39.984504, 116.314625], [39.984485, 116.314426], [39.984427, 116.31424], [39.984485, 116.314042], [39.98448, 116.313818], [39.984501, 116.313659], [39.984618, 116.314323], [39.984649, 116.314107], [39.984621, 116.313941], [39.984655, 116.313724], [39.984681, 116.313521], [39.984708, 116.313311], [39.984708, 116.313099], [39.984696, 116.312921], [39.984677, 116.312746], [39.984682, 116.312525], [39.984649, 116.312332], [39.984641, 116.312123], [39.984647, 116.311917], [39.984654, 116.31172], [39.984631, 116.311569], [39.984647, 116.31138], [39.984653, 116.311189], [39.984628, 116.311026], [39.984652, 116.310854], [39.984656, 116.31066], [39.984616, 116.310534], [39.984676, 116.31033], [39.984698, 116.310063], [39.984696, 116.309937], [39.984663, 116.309851], [39.984598, 116.309749], [39.98454, 116.309656], [39.984525, 116.309503], [39.984498, 116.309348], [39.984481, 116.309173], [39.984489, 116.308993], [39.98447, 116.308827], [39.98449, 116.308638], [39.98449, 116.308485], [39.984494, 116.308351], [39.984499, 116.308201], [39.984484, 116.308049], [39.984491, 116.307902], [39.984499, 116.307809], [39.984472, 116.307687], [39.984493, 116.307548], [39.984488, 116.307434], [39.984427, 116.307292], [39.984428, 116.307126], [39.984432, 116.306943], [39.984425, 116.306801], [39.984438, 116.306633], [39.984462, 116.306486], [39.984466, 116.3063], [39.984456, 116.306047], [39.984454, 116.305854], [39.984412, 116.305682], [39.98441, 116.305466], [39.984406, 116.305281], [39.984393, 116.305023], [39.984356, 116.304909], [39.984352, 116.304704], [39.984338, 116.304543], [39.984338, 116.304315], [39.984349, 116.304083], [39.984368, 116.303934], [39.984437, 116.303813], [39.984429, 116.303672], [39.984342, 116.303444], [39.984365, 116.303298], [39.984368, 116.303132], [39.984385, 116.30292], [39.98438, 116.302754], [39.984346, 116.302601], [39.984303, 116.302457], [39.984344, 116.302271], [39.984341, 116.302094], [39.984359, 116.301888], [39.984379, 116.301693], [39.984345, 116.3015], [39.984345, 116.301309], [39.984338, 116.301107], [39.984344, 116.300877], [39.984278, 116.300674], [39.984276, 116.300462], [39.984278, 116.300307], [39.984252, 116.300156], [39.984288, 116.299943], [39.984283, 116.29981], [39.984335, 116.299744], [39.984312, 116.299703], [39.984177, 116.299699], [39.98414, 116.299697], [39.984204, 116.299721], [39.984258, 116.299736], [39.984031, 116.299573], [39.98379, 116.299578], [39.983726, 116.299566], [39.983692, 116.299496], [39.983685, 116.299476], [39.983639, 116.299425], [39.983629, 116.299353], [39.983641, 116.299279], [39.983557, 116.299235], [39.983509, 116.299238], [39.983413, 116.299267], [39.983353, 116.299305], [39.983337, 116.299321], [39.9833, 116.299314], [39.9833, 116.299314], [39.983304, 116.299307], [39.983279, 116.299311], [39.983302, 116.299302], [39.983276, 116.299265], [39.983322, 116.299191], [39.983403, 116.299147], [39.983548, 116.299083], [39.983675, 116.299031], [39.983663, 116.298932], [39.983533, 116.298903], [39.98359, 116.298869], [39.983723, 116.298825], [39.983902, 116.298773], [39.984045, 116.298725], [39.984019, 116.298663], [39.995777, 116.286798], [39.996832, 116.285446], [39.984397, 116.299292], [39.984426, 116.299329], [39.984499, 116.299413], [39.984424, 116.299467], [39.98441, 116.299477], [39.984421, 116.299569], [39.984518, 116.29953], [39.984488, 116.299645], [39.98454, 116.299523], [39.98446, 116.299528], [39.984463, 116.299508], [39.984501, 116.299473], [39.984532, 116.299451], [39.984532, 116.299451], [39.984527, 116.299451], [39.984517, 116.299447], [39.984509, 116.299438], [39.984497, 116.299411], [39.984499, 116.299405], [39.984498, 116.299407], [39.984498, 116.299407], [39.984493, 116.299412], [39.984498, 116.299466], [39.984546, 116.29941], [39.984638, 116.299318], [39.98473, 116.299315], [39.984753, 116.299305], [39.984789, 116.299297], [39.984795, 116.299391], [39.984778, 116.299504], [39.984743, 116.299617], [39.984671, 116.299625], [39.984694, 116.299536], [39.984733, 116.29952], [39.983841, 116.299902], [39.983861, 116.300177], [39.983842, 116.300329], [39.983984, 116.300308], [39.984126, 116.300188], [39.984246, 116.300058], [39.984373, 116.300019], [39.984533, 116.300043], [39.984723, 116.300058], [39.984789, 116.300151], [39.984837, 116.300216], [39.984859, 116.300332], [39.984888, 116.300514], [39.984896, 116.300689], [39.984905, 116.300885], [39.984911, 116.301049], [39.984925, 116.301221], [39.98493, 116.301391], [39.984938, 116.301568], [39.984948, 116.301741], [39.984945, 116.301915], [39.984953, 116.302055], [39.984953, 116.302264], [39.98496, 116.302488], [39.984973, 116.302679], [39.984983, 116.30286], [39.985009, 116.303037], [39.985043, 116.303258], [39.98503, 116.303496], [39.985039, 116.303685], [39.985028, 116.303884], [39.984993, 116.304067], [39.985027, 116.304163], [39.985038, 116.30426], [39.985042, 116.304459], [39.985029, 116.304647], [39.985023, 116.304811], [39.985031, 116.304927], [39.985082, 116.305192], [39.985105, 116.305348], [39.985132, 116.305499], [39.985169, 116.305649], [39.985135, 116.305834], [39.985146, 116.305984], [39.985131, 116.306178], [39.985127, 116.306363], [39.985135, 116.306531], [39.985157, 116.306711], [39.98517, 116.306893], [39.985154, 116.307092], [39.985184, 116.307341], [39.98521, 116.30751], [39.985231, 116.307633], [39.98526, 116.307735], [39.98524, 116.307933], [39.985225, 116.308133], [39.985256, 116.308313], [39.985218, 116.308579], [39.985201, 116.308774], [39.985203, 116.30898], [39.985221, 116.309152], [39.985194, 116.30931], [39.985161, 116.309494], [39.98519, 116.309701], [39.985202, 116.309888], [39.985282, 116.30998], [39.985443, 116.30998], [39.985579, 116.309969], [39.985721, 116.309961], [39.98584, 116.309941], [39.98595, 116.309978], [39.986051, 116.310034], [39.986174, 116.310025], [39.986305, 116.309956], [39.986461, 116.309885], [39.986611, 116.309862], [39.986697, 116.309893], [39.986793, 116.309956], [39.986929, 116.309974], [39.987073, 116.309987], [39.987211, 116.310004], [39.987325, 116.31007], [39.987458, 116.310084], [39.987591, 116.310088], [39.987747, 116.310049], [39.987884, 116.310027], [39.988008, 116.310059], [39.988111, 116.310052], [39.988293, 116.309902], [39.988397, 116.309931], [39.988553, 116.309866], [39.988679, 116.309824], [39.988772, 116.309784], [39.988901, 116.309793], [39.989029, 116.309833], [39.989173, 116.309866], [39.989287, 116.309905], [39.989392, 116.309949], [39.989519, 116.310031], [39.989628, 116.310049], [39.989762, 116.310024], [39.989838, 116.310098], [39.989981, 116.310115], [39.990089, 116.310169], [39.990219, 116.310215], [39.990325, 116.310258], [39.990406, 116.310277], [39.99056, 116.31019], [39.99065, 116.310134], [39.990693, 116.310114], [39.990696, 116.310111], [39.990698, 116.310105], [39.990698, 116.310103], [39.990696, 116.310101], [39.990695, 116.310095], [39.990692, 116.310092], [39.99069, 116.31009], [39.990689, 116.310088], [39.990689, 116.310087], [39.990689, 116.310087], [39.990696, 116.31009], [39.990743, 116.310066], [39.990793, 116.310109], [39.990837, 116.310205], [39.990873, 116.310318], [39.990887, 116.310479], [39.990874, 116.310657], [39.990906, 116.310827], [39.990921, 116.310971], [39.990933, 116.311149], [39.990969, 116.311312], [39.990994, 116.311507], [39.991014, 116.311693], [39.99101, 116.311915], [39.991033, 116.312107], [39.991055, 116.312282], [39.991058, 116.312473], [39.991032, 116.312666], [39.991024, 116.312853], [39.991022, 116.313047], [39.991018, 116.313244], [39.991016, 116.313469], [39.991035, 116.313681], [39.991063, 116.31384], [39.991072, 116.31403], [39.991068, 116.314209], [39.991095, 116.314385], [39.991113, 116.314596], [39.991128, 116.314797], [39.991127, 116.315003], [39.991148, 116.315193], [39.991176, 116.315342], [39.991215, 116.315529], [39.991209, 116.315643], [39.991191, 116.31579], [39.991188, 116.315958], [39.991189, 116.316172], [39.991186, 116.316381], [39.991194, 116.316575], [39.991208, 116.316756], [39.99122, 116.316999], [39.991197, 116.317235], [39.991183, 116.317452], [39.991164, 116.317661], [39.991187, 116.317874], [39.991179, 116.318083], [39.991132, 116.318231], [39.991169, 116.31848], [39.991183, 116.318691], [39.991204, 116.318904], [39.991201, 116.319098], [39.991194, 116.319315], [39.991187, 116.31949], [39.991206, 116.319683], [39.991239, 116.319866], [39.991258, 116.320062], [39.991282, 116.320255], [39.991288, 116.320445], [39.991308, 116.320622], [39.991325, 116.320803], [39.991352, 116.321002], [39.991382, 116.321179], [39.991388, 116.321384], [39.991389, 116.321583], [39.991368, 116.321736], [39.99141, 116.321874], [39.991412, 116.322004], [39.991406, 116.322176], [39.991403, 116.322296], [39.991401, 116.322436], [39.991477, 116.322668], [39.991591, 116.322784], [39.991716, 116.322778], [39.991863, 116.322774], [39.992007, 116.322784], [39.992201, 116.322812], [39.992365, 116.3228], [39.992456, 116.322797], [39.9926, 116.32281], [39.992777, 116.322891], [39.992883, 116.322891], [39.993001, 116.322713], [39.993077, 116.322617], [39.993222, 116.322651], [39.993429, 116.32276], [39.993535, 116.322744], [39.99364, 116.322658], [39.993796, 116.322579], [39.994055, 116.322804], [39.994175, 116.322829], [39.994276, 116.322786], [39.994471, 116.322763], [39.994648, 116.322723], [39.99481, 116.322641], [39.994946, 116.322625], [39.995093, 116.32262], [39.995235, 116.322606], [39.995392, 116.322607], [39.995567, 116.322533], [39.995718, 116.32252], [39.995852, 116.322517], [39.995993, 116.322556], [39.99611, 116.322544], [39.996234, 116.322552], [39.996392, 116.322481], [39.996534, 116.322464], [39.996632, 116.322425], [39.996645, 116.322412], [39.996725, 116.322348], [39.996881, 116.322337], [39.997081, 116.322428], [39.997277, 116.322428], [39.997592, 116.322314], [39.99775, 116.322301], [39.997865, 116.322317], [39.997988, 116.32231], [39.998151, 116.322261], [39.998307, 116.322268], [39.998452, 116.322236], [39.998603, 116.322225], [39.998753, 116.322225], [39.998895, 116.322254], [39.999078, 116.322196], [39.999218, 116.322176], [39.999364, 116.322161], [39.999484, 116.322148], [39.999607, 116.322178], [39.999602, 116.322324], [39.999603, 116.322434], [39.999586, 116.322587], [39.999573, 116.32276], [39.999572, 116.322932], [39.999565, 116.323134], [39.999569, 116.32328], [39.999575, 116.323448], [39.999568, 116.323605], [39.999558, 116.323605], [39.999581, 116.323732], [39.999653, 116.324069], [39.999678, 116.324258], [39.999646, 116.324405], [39.999676, 116.324452], [39.999678, 116.324453], [39.999682, 116.324455], [39.999682, 116.324455], [39.999676, 116.324456], [39.999641, 116.32451], [39.999662, 116.324481], [39.999651, 116.324477], [39.999664, 116.324493], [39.999684, 116.324511], [39.999684, 116.324511], [39.999678, 116.324511], [39.999667, 116.324512], [39.999655, 116.324513], [39.999703, 116.324496], [39.99956, 116.324498], [39.999506, 116.324545], [39.999516, 116.324531], [39.999567, 116.324478], [39.999573, 116.3246], [39.999538, 116.324639], [39.999598, 116.324684], [39.999666, 116.324722], [39.999729, 116.324801], [39.999769, 116.324886], [40.004775, 116.320158], [40.004783, 116.320388], [40.004799, 116.320545], [40.004835, 116.320683], [40.004851, 116.320835], [40.004868, 116.32101], [40.004849, 116.321153], [40.004879, 116.321277], [40.004962, 116.321318], [40.005088, 116.32128], [40.00525, 116.32126], [40.005455, 116.321389], [40.005621, 116.321455], [40.005738, 116.321491], [40.005883, 116.321518], [40.006051, 116.321521], [40.006178, 116.321463], [40.00633, 116.321461], [40.006482, 116.321474], [40.006631, 116.321459], [40.006813, 116.321447], [40.006974, 116.321454], [40.007122, 116.321396], [40.007235, 116.321356], [40.00741, 116.321395], [40.007571, 116.321412], [40.007715, 116.321414], [40.007862, 116.321426], [40.008034, 116.321437], [40.00817, 116.321441], [40.008337, 116.321425], [40.008515, 116.321421], [40.008668, 116.321446], [40.008782, 116.321443], [40.008843, 116.321385], [40.008884, 116.321402], [40.00895, 116.321449], [40.009006, 116.321502], [40.009026, 116.321564], [40.009011, 116.321623], [40.009021, 116.321625], [40.009021, 116.321625], [40.00902, 116.321631], [40.009013, 116.321659], [40.008921, 116.321484], [40.008582, 116.322217], [40.008481, 116.32244], [40.008496, 116.322406], [40.00888, 116.321628], [40.00898, 116.321587], [40.00898, 116.321544], [40.008984, 116.321525], [40.008984, 116.321525], [40.008982, 116.321517], [40.008958, 116.321457], [40.008971, 116.321436], [40.009022, 116.321434], [40.009025, 116.321374], [40.00903, 116.321397], [40.009062, 116.321462], [40.009081, 116.321486], [40.00908, 116.321479], [40.00908, 116.321479], [40.009081, 116.321481], [40.009083, 116.321491], [40.009094, 116.32152], [40.009072, 116.321585], [40.009083, 116.321467], [40.00908, 116.321442], [40.009087, 116.321453], [40.009065, 116.321479], [40.009071, 116.321517], [40.009075, 116.32156], [40.009105, 116.321616], [40.00908, 116.32156], [40.009031, 116.321491], [40.008995, 116.321407], [40.008995, 116.321407], [40.008999, 116.321412], [40.008997, 116.321399], [40.008994, 116.321389], [40.008994, 116.321389], [40.008995, 116.321392], [40.009235, 116.321472], [40.009268, 116.321446], [40.00927, 116.321447], [40.00927, 116.321447], [40.009272, 116.321451], [40.00928, 116.321473], [40.009278, 116.32147], [40.009242, 116.321445], [40.009187, 116.32143], [40.009098, 116.321437], [40.009045, 116.321485], [40.009008, 116.321449], [40.008993, 116.321501], [40.009017, 116.321558], [40.008999, 116.321511], [40.008999, 116.321511], [40.008997, 116.321518], [40.008999, 116.321537], [40.009026, 116.321518], [40.009009, 116.321499], [40.009009, 116.321499], [40.009011, 116.321506], [40.009013, 116.321522], [40.009012, 116.321576], [40.009034, 116.321569], [40.009034, 116.321569], [40.009038, 116.321575], [40.009024, 116.321614], [40.009015, 116.321526], [40.008997, 116.321432], [40.008995, 116.321455], [40.008997, 116.321485], [40.009032, 116.32151], [40.009074, 116.32148], [40.009101, 116.32153], [40.009157, 116.321596], [40.009219, 116.321657], [40.009247, 116.321721], [40.009273, 116.321781], [40.009313, 116.321871], [40.009344, 116.321952], [40.009356, 116.322007], [40.009386, 116.322103], [40.009356, 116.322121], [40.009353, 116.322135], [40.009319, 116.322152], [40.009394, 116.322162], [40.009399, 116.322179], [40.009344, 116.32219], [40.009342, 116.322177], [40.009318, 116.32219], [40.009287, 116.322206], [40.00927, 116.32222], [40.009351, 116.321916], [40.009336, 116.321838], [40.009331, 116.321811], [40.009314, 116.321823], [40.009314, 116.321833], [40.009316, 116.32185], [40.009428, 116.320888], [40.008854, 116.321493], [40.008848, 116.321349], [40.008874, 116.32116], [40.008852, 116.321109], [40.008786, 116.321037], [40.008767, 116.321012], [40.008735, 116.320977], [40.008694, 116.320964], [40.008665, 116.320937], [40.008635, 116.320886], [40.008612, 116.32083], [40.008591, 116.3208], [40.008574, 116.320772], [40.008521, 116.320688], [40.008471, 116.320669], [40.008419, 116.320654], [40.008362, 116.320619], [40.008348, 116.320573], [40.008309, 116.320547], [40.008281, 116.320543], [40.008234, 116.320499], [40.008163, 116.320473], [40.008129, 116.320418], [40.008121, 116.320359], [40.008069, 116.320335], [40.008027, 116.320309], [40.00801, 116.320287], [40.007959, 116.320241], [40.007947, 116.320238], [40.007879, 116.320237], [40.007826, 116.320239], [40.007818, 116.320239], [40.007818, 116.320239], [40.007819, 116.32024], [40.007817, 116.32023], [40.007834, 116.320181], [40.007761, 116.320093], [40.007661, 116.319986], [40.007623, 116.319953], [40.007623, 116.319953], [40.007621, 116.31995], [40.007575, 116.31987], [40.007551, 116.319732], [40.007526, 116.31965], [40.007468, 116.319517], [40.007465, 116.319506], [40.007462, 116.319493], [40.007459, 116.319436], [40.007453, 116.319403], [40.007454, 116.319391], [40.007474, 116.319376], [40.0075, 116.319364], [40.007524, 116.319357], [40.007524, 116.319321], [40.007517, 116.319312], [40.007551, 116.319307], [40.007551, 116.319307], [40.007555, 116.319313], [40.00759, 116.31934], [40.00761, 116.319355], [40.007615, 116.319369], [40.007621, 116.319385], [40.007644, 116.319403], [40.007663, 116.319417], [40.007663, 116.319417], [40.007669, 116.319414], [40.007661, 116.319384], [40.007654, 116.319321], [40.007654, 116.319266], [40.00767, 116.319215], [40.007694, 116.319181], [40.007699, 116.319151], [40.007272, 116.319756], [40.007331, 116.319657], [40.007428, 116.319432], [40.007395, 116.319354], [40.007447, 116.319379], [40.007479, 116.319371], [40.007516, 116.319316], [40.007575, 116.319238], [40.007288, 116.319088], [40.007288, 116.319088], [40.007284, 116.319084], [40.007298, 116.319036], [40.007365, 116.31903], [40.007416, 116.319007], [40.007482, 116.318957], [40.007548, 116.318852], [40.007627, 116.318775], [40.007718, 116.318705], [40.007808, 116.318623], [40.007877, 116.318546], [40.007945, 116.318487], [40.00803, 116.318444], [40.008125, 116.318365], [40.008215, 116.318248], [40.008168, 116.318293], [40.008015, 116.318471], [40.008049, 116.318444], [40.008064, 116.31838], [40.008118, 116.318326], [40.008197, 116.318275], [40.008289, 116.318251], [40.008305, 116.318267], [40.008276, 116.318339], [40.008184, 116.318474], [40.008071, 116.318568], [40.007954, 116.318639], [40.007884, 116.318684], [40.007867, 116.318699], [40.007835, 116.318706], [40.007717, 116.318842], [40.007726, 116.318826], [40.007721, 116.318792], [40.007753, 116.318741], [40.007803, 116.318672], [40.007852, 116.318565], [40.007925, 116.318494], [40.008019, 116.318455], [40.006977, 116.319607], [40.007203, 116.319334], [40.00735, 116.319131], [40.007504, 116.318956], [40.007611, 116.318793], [40.007773, 116.31865], [40.007966, 116.31854], [40.007399, 116.31912], [40.007411, 116.319124], [40.00744, 116.31909], [40.007496, 116.319085], [40.00754, 116.31909], [40.007619, 116.319094], [40.007648, 116.319041], [40.007681, 116.318962], [40.007724, 116.318892], [40.007766, 116.318825], [40.007809, 116.318799], [40.007849, 116.318754], [40.007905, 116.31869], [40.007878, 116.318784], [40.007616, 116.318863], [40.007692, 116.318817], [40.007794, 116.318827], [40.007898, 116.318829], [40.007981, 116.318788], [40.008009, 116.318763], [40.008031, 116.318756], [40.008055, 116.318753], [40.008237, 116.318816], [40.008306, 116.318941], [40.008283, 116.318897], [40.0083, 116.318936], [40.007645, 116.319454], [40.007582, 116.319409], [40.007581, 116.319385], [40.007612, 116.319403], [40.007694, 116.319429], [40.007778, 116.319475], [40.007876, 116.319505], [40.007974, 116.319529], [40.008096, 116.319537], [40.008196, 116.319549], [40.008292, 116.319591], [40.008369, 116.319618], [40.008421, 116.319597], [40.008452, 116.319548], [40.008503, 116.319525], [40.008544, 116.31949], [40.008601, 116.319482], [40.008617, 116.319483], [40.008617, 116.319483], [40.008625, 116.319489], [40.00864, 116.319488], [40.008645, 116.319484], [40.008645, 116.319484], [40.008649, 116.319481], [40.008669, 116.319455], [40.006747, 116.318549], [40.006747, 116.318549], [40.006755, 116.318544], [40.006742, 116.318571], [40.006744, 116.31856], [40.006745, 116.318572], [40.006745, 116.318581], [40.006739, 116.318568], [40.006722, 116.318548], [40.006719, 116.318565], [40.006724, 116.318625], [40.006745, 116.318817], [40.006715, 116.318884], [40.006721, 116.318965], [40.006753, 116.319072], [40.006785, 116.319175], [40.00681, 116.319239], [40.006849, 116.319286], [40.006811, 116.319309], [40.006789, 116.319351], [40.006791, 116.319398], [40.006828, 116.319424], [40.006872, 116.319419], [40.006893, 116.319381], [40.006975, 116.319294], [40.007457, 116.319674], [40.007457, 116.319674], [40.007458, 116.319676], [40.007479, 116.319695], [40.007572, 116.319786], [40.007582, 116.319816], [40.007621, 116.319834], [40.007629, 116.31989], [40.007634, 116.319966], [40.007646, 116.32005], [40.00766, 116.320119], [40.007686, 116.320243], [40.007748, 116.320301], [40.007802, 116.320389], [40.007819, 116.320364], [40.007853, 116.320343], [40.007912, 116.320328], [40.007978, 116.320325], [40.007999, 116.320339], [40.008036, 116.320394], [40.008125, 116.320486], [40.008172, 116.320571], [40.008182, 116.320646], [40.008226, 116.320738], [40.008236, 116.32081], [40.008306, 116.320851], [40.008373, 116.320857], [40.008418, 116.320872], [40.00846, 116.320864], [40.008507, 116.320918], [40.008535, 116.320997], [40.008565, 116.321079], [40.008619, 116.321168], [40.008663, 116.321249], [40.008684, 116.321297], [40.008724, 116.321395], [40.008776, 116.321462], [40.008804, 116.321504], [40.008839, 116.321516], [40.008879, 116.321555], [40.008891, 116.321571], [40.008873, 116.321615], [40.008858, 116.321677], [40.008864, 116.321766], [40.00887, 116.321858], [40.008864, 116.321933], [40.008862, 116.322009], [40.008855, 116.322087], [40.008873, 116.322144], [40.008874, 116.322234], [40.008869, 116.322306], [40.008835, 116.322331], [40.008814, 116.322311], [40.008813, 116.3223], [40.008813, 116.3223], [40.008821, 116.322297], [40.008833, 116.322297], [40.008842, 116.322298], [40.008761, 116.323722], [40.008765, 116.32369], [40.00865, 116.323112], [40.008786, 116.322741], [40.008889, 116.322551], [40.008962, 116.322462], [40.008988, 116.322356], [40.009068, 116.322259], [40.009107, 116.322177], [40.009086, 116.322088], [40.008929, 116.321992], [40.008849, 116.32191], [40.008799, 116.32185], [40.008827, 116.321784], [40.008862, 116.321736], [40.008898, 116.321695], [40.008901, 116.321684], [40.008905, 116.321683], [40.008905, 116.321683], [40.008905, 116.321682], [40.008934, 116.321623], [40.008945, 116.321551], [40.008851, 116.321485], [40.008607, 116.321862], [40.008652, 116.322251], [40.008897, 116.321603], [40.008928, 116.32161], [40.009013, 116.321431], [40.009027, 116.321399], [40.009064, 116.321326], [40.009172, 116.321211], [40.009204, 116.32113], [40.009243, 116.32105], [40.009269, 116.320978], [40.009328, 116.320887]]
a [[ 39.984702 116.318417]
[ 39.984683 116.31845 ]
[ 39.984686 116.318417]
...,
[ 40.009243 116.32105 ]
[ 40.009269 116.320978]
[ 40.009328 116.320887]]
a1 [[ 39.984702 39.984683 39.984686 ..., 40.009243 40.009269
40.009328]
[ 116.318417 116.31845 116.318417 ..., 116.32105 116.320978
116.320887]]
dataSet原先是列表,我试过其他类型的序列,最后得出结论,np.mat()是将序列转为np的二维数组,np.transpose()是将数组转置
np.mat()和np.transpose的更多相关文章
- np.repeat 与 np.tile
1.Numpy的 tile() 函数,就是将原矩阵横向.纵向地复制.tile 是瓷砖的意思,顾名思义,这个函数就是把数组像瓷砖一样铺展开来. 举个例子,原矩阵: import numpy as np ...
- numpy中np.c_和np.r_
np.r_:按列连接两个矩阵,就是把两矩阵上下相加,要求列数相等,类似于pandas中的concat() np.c_:按行连接两个矩阵,就是把两矩阵左右相加,要求行数相等,类似于pandas中的mer ...
- p,np,npc,np难问题,确定图灵机与非确定图灵机
本文转自豆瓣_燃烧的影子 图灵机与可计算性 图灵(1912~1954)出生于英国伦敦,19岁进入剑桥皇家学院研究量子力学和数理逻辑.1935年,图灵写出了"论高斯误差函数"的论文, ...
- np.tile 和np.newaxis
output array([[ 0.24747071, -0.43886742], [-0.03916734, -0.70580089], [ 0.00462337, -0.5143158 ...
- numpy 辨异(四)—— np.repeat 与 np.tile
>> import numpy as np >> help(np.repeat) >> help(np.tile) 二者执行的是均是复制操作: np.repeat: ...
- numpy 下的数据结构与数据类型的转换(np.array vs. np.asarray)
1. np.asarray -- numpy 风格的类型转换 从已有多维数组创建新的多维数组,数据类型可重新设置 >> B = np.asarray(A, dtype='int32') 2 ...
- dtypes.py", line 499 _np_qint8 = np.dtype([("qint8", np.int8, (1,)])
Traceback (most recent call last): File "<stdin>", line 1, in <module> File &q ...
- python多项式拟合:np.polyfit 和 np.polyld
python数据拟合主要可采用numpy库,库的安装可直接用pip install numpy等. 1. 原始数据:假如要拟合的数据yyy来自sin函数,np.sin import numpy as ...
- np.c_与np.r_
import sys reload(sys) sys.setdefaultencoding('utf-8') import numpy as np def test(): ''' numpy函数np. ...
随机推荐
- 自学Zabbix6.1 Event acknowledgment 事件确认
自学Zabbix6.1 Event acknowledgment 事件确认 1 概述以往服务器出现报警,运维人员处理完事之后,报警自动取消,但是下一次出现同样一个错误,但是换了一个运维人员,他可能需要 ...
- 【UOJ#275】组合数问题(卢卡斯定理,动态规划)
[UOJ#275]组合数问题(卢卡斯定理,动态规划) 题面 UOJ 题解 数据范围很大,并且涉及的是求值,没法用矩阵乘法考虑. 发现\(k\)的限制是,\(k\)是一个质数,那么在大组合数模小质数的情 ...
- 洛谷P4240 毒瘤之神的考验 【莫比乌斯反演 + 分块打表】
题目链接 洛谷P4240 题解 式子不难推,分块打表真的没想到 首先考虑如何拆开\(\varphi(ij)\) 考虑公式 \[\varphi(ij) = ij\prod\limits_{p | ij} ...
- centos7安装redis的正确姿势
目前redis5已经发布,Redis 5 是 Redis 引入流数据类型(Stream data type)的第一个版本.按照官方的说法,不使用该特性的用户在生产环境中使用 Redis 5 会有更好的 ...
- Linux 常用命令——df, du, ln
1. df 列出文件系统的整体磁盘使用量 2. du 评估文件系统的磁盘使用量(常用在推估目录所占容量),也可以计算文件或文件夹大小 3. ln 创建实体连接(hard link) 或 符号连接(Sy ...
- HDU 3081 Marriage Match II (网络流,最大流,二分,并查集)
HDU 3081 Marriage Match II (网络流,最大流,二分,并查集) Description Presumably, you all have known the question ...
- 转载:OSG::Quat(四元数)用法
转自:http://blog.163.com/dj_zone/blog/static/4908931320098294047820/ osg::Quat To set the attitude of ...
- java web 使用maven打包绕过单元测试
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-suref ...
- 搭建一个简单的node.js服务器
第一步:安装node.js.可以去官网:https://nodejs.org/en/进行下载. 查看是否成功,只需在控制台输入 node -v.出现版本号的话,就证明成功了. 第二步:编写node.j ...
- java实现获取当前年月日 小时 分钟 秒 毫秒
java代码实现如下 view source print? /** * 英文简写(默认)如:2010-12-01 */ public static String F ...