txtファイルの中身の一部
0 -0.10778473072856658 0.0 534.4673276334413 1 -86.91843202417452 -31.272376576945117 544.275749869217 2 -156.08660696664396 -85.68668980088205 290.26161236460837 3 -231.94358572422004 17.577715759547544 29.196091795388043 6 88.07095448061722 31.2721571558353 524.534725679862 7 146.56469571882283 -124.9990118278697 264.5743103785835 8 176.7558706603975 -142.4990483599251 58.97981418193831 12 12.943065925992794 5.29321590110731 684.659675560762 13 17.451771820870427 -2.377960713105807 920.0114879511895 14 45.33560922409042 -50.51124123420235 975.2731015961849 15 58.146551098923084 -33.94524191243286 1104.8481404570057 17 144.7706605463885 43.627652504039325 878.5311426360776 18 163.23734749448406 100.3675217475664 691.7252631104815 19 160.57995782562423 24.43915114407416 532.9220266584131 25 -110.33110775575588 -39.407140457243344 891.9279893575855 26 -157.0019092426122 -67.82581164704341 718.6620220215236 27 -197.8901790721251 -173.60275837044557 567.7054104278092
python
import numpy as np import math from numpy import array from numpy import linalg as LA import numpy #インスートール
python
txt = np.loadtxt('') #print(type(txt)) print(txt) #print(txt.dtype) numpy.set_printoptions(threshold=numpy.inf)
実行結果
[[ 0.00000000e+00 -1.07784731e-01 0.00000000e+00 5.34467328e+02 1.00000000e+00 -8.69184320e+01 -3.12723766e+01 5.44275750e+02 2.00000000e+00 -1.56086607e+02 -8.56866898e+01 2.90261612e+02 3.00000000e+00 -2.31943586e+02 1.75777158e+01 2.91960918e+01 6.00000000e+00 8.80709545e+01 3.12721572e+01 5.24534726e+02 7.00000000e+00 1.46564696e+02 -1.24999012e+02 2.64574310e+02 8.00000000e+00 1.76755871e+02 -1.42499048e+02 5.89798142e+01 1.20000000e+01 1.29430659e+01 5.29321590e+00 6.84659676e+02 1.30000000e+01 1.74517718e+01 -2.37796071e+00 9.20011488e+02 1.40000000e+01 4.53356092e+01 -5.05112412e+01 9.75273102e+02 1.50000000e+01 5.81465511e+01 -3.39452419e+01 1.10484814e+03 1.70000000e+01 1.44770661e+02 4.36276525e+01 8.78531143e+02 1.80000000e+01 1.63237347e+02 1.00367522e+02 6.91725263e+02 1.90000000e+01 1.60579958e+02 2.44391511e+01 5.32922027e+02 2.50000000e+01 -1.10331108e+02 -3.94071405e+01 8.91927989e+02 2.60000000e+01 -1.57001909e+02 -6.78258116e+01 7.18662022e+02 2.70000000e+01 -1.97890179e+02 -1.73602758e+02 5.67705410e+02] [ 0.00000000e+00 7.96067226e+00 0.00000000e+00 5.34467328e+02 1.00000000e+00 -7.86733537e+01 -4.08364468e+01 5.44846344e+02 2.00000000e+00 -1.56175309e+02 -8.34622445e+01 2.74353364e+02 3.00000000e+00 -2.32477462e+02 2.68251833e+01 3.49050397e+00 6.00000000e+00 9.63801736e+01 4.08361849e+01 5.23926152e+02 7.00000000e+00 1.61828667e+02 -1.25224690e+02 2.56711460e+02 8.00000000e+00 1.83327308e+02 -1.66498479e+02 3.32697396e+01 1.20000000e+01 4.10959938e+00 -5.72516647e+00 6.84696032e+02 1.30000000e+01 1.65208746e+01 -3.22858190e+01 9.10375409e+02 1.40000000e+01 4.79081717e+01 -8.17596567e+01 9.59196453e+02 1.50000000e+01 5.69742857e+01 -7.48734774e+01 1.08652975e+03 1.70000000e+01 1.44299627e+02 3.04710861e+01 8.78213975e+02 1.80000000e+01 1.63776461e+02 1.13909537e+02 6.91430254e+02 1.90000000e+01 2.59363672e+02 7.06916306e+01 5.30070310e+02 2.50000000e+01 -1.09205081e+02 -7.98285109e+01 8.90796387e+02 2.60000000e+01 -1.55044880e+02 -1.16840377e+02 7.19439695e+02 2.70000000e+01 -1.95748453e+02 -2.15015097e+02 5.70014403e+02] [ 0.00000000e+00 -1.07784731e-01 0.00000000e+00 5.06706344e+02 1.00000000e+00 -8.73267156e+01 -1.26299986e+01 4.95875216e+02 2.00000000e+00 -1.56429291e+02 -7.73769357e+01 2.34281023e+02 3.00000000e+00 -2.63113139e+02 5.80732139e+00 -8.11537712e+00 6.00000000e+00 8.76636791e+01 1.26299417e+01 5.17611578e+02 7.00000000e+00 1.45727671e+02 -1.47128988e+02 2.59663216e+02 8.00000000e+00 1.90778792e+02 -1.67921432e+02 2.57659374e+01 1.20000000e+01 -2.90373417e+01 -5.04701331e+01 6.96023351e+02 1.30000000e+01 -9.36505214e+01 -1.17645517e+02 8.84573591e+02 1.40000000e+01 -1.00811227e+02 -1.63083000e+02 9.28644787e+02 1.50000000e+01 -1.14791253e+02 -1.61989657e+02 1.04961596e+03 1.70000000e+01 1.54713634e+01 -8.59225135e+01 8.67083497e+02 1.80000000e+01 1.49839365e+02 -3.27341414e+01 6.94624844e+02 1.90000000e+01 1.57239443e+02 -5.92805153e+01 5.38083799e+02 2.50000000e+01 -1.62095302e+02 -1.31142924e+02 7.88956258e+02 2.60000000e+01 -1.60028214e+02 -1.80304283e+02 5.98846649e+02 2.70000000e+01 -1.99311476e+02 -2.96582914e+02 4.49238992e+02] [ 0.00000000e+00 -6.77574595e+01 0.00000000e+00 4.70855089e+02 1.00000000e+00 -1.42007355e+02 -4.12874578e+01 4.34746912e+02 2.00000000e+00 -2.09781551e+02 -9.77348485e+01 2.14210758e+02 3.00000000e+00 -2.76131194e+02 -3.25649294e+01 -8.35829090e-01 6.00000000e+00 8.05580466e+00 4.12871886e+01 5.07783252e+02 7.00000000e+00 1.45641474e+02 -1.46335632e+02 2.51928447e+02 8.00000000e+00 1.80197802e+02 -2.31938625e+02 2.34432934e+01 1.20000000e+01 -2.07571331e+02 -7.27856711e+00 6.11810851e+02 1.30000000e+01 -2.87836783e+02 -4.37489487e+01 7.77486246e+02 1.40000000e+01 -2.79964653e+02 -7.77328728e+01 8.19233849e+02 1.50000000e+01 -2.98793883e+02 -8.54805435e+01 9.32250067e+02 1.70000000e+01 -1.67871385e+02 1.63445223e+01 8.13865975e+02 1.80000000e+01 -4.11378403e+01 1.45064463e+02 6.74024098e+02 1.90000000e+01 -9.00979764e-02 1.92009617e+02 5.05942443e+02 2.50000000e+01 -3.42198922e+02 -9.38250122e+01 7.19300079e+02 2.60000000e+01 -3.27528207e+02 -1.71770565e+02 5.75499614e+02 2.70000000e+01 -3.10988403e+02 -2.79509916e+02 4.62974033e+02] [ 0.00000000e+00 -1.83258422e+02 0.00000000e+00 4.39013683e+02 1.00000000e+00 -2.68332652e+02 -3.82497057e+01 4.34481173e+02 2.00000000e+00 -2.83495071e+02 -2.54138260e+02 2.36929788e+02 3.00000000e+00 -2.50199183e+02 -4.08465095e+02 7.30953112e+01 6.00000000e+00 -9.65076087e+01 3.82494984e+01 4.43696887e+02 7.00000000e+00 6.68508039e+01 -2.69055068e+02 2.68778271e+02 8.00000000e+00 1.61826220e+02 -6.16101179e+02 9.40180487e+01 1.20000000e+01 -2.58518873e+02 1.45907961e+02 5.69533996e+02 1.30000000e+01 -3.06899741e+02 2.56709646e+02 7.80318654e+02 1.40000000e+01 -2.91150775e+02 2.34990588e+02 8.29296035e+02 1.50000000e+01 -3.04247775e+02 2.52019722e+02 9.45553199e+02 1.70000000e+01 -1.79400132e+02 2.92171270e+02 7.55729802e+02 1.80000000e+01 -5.20104242e+01 3.65347682e+02 6.24995484e+02 1.90000000e+01 -1.02718965e+02 2.99483925e+02 4.98723743e+02 2.50000000e+01 -4.09352307e+02 1.93975152e+02 7.14750411e+02 2.60000000e+01 -4.23954628e+02 1.78219394e+02 5.56707436e+02 2.70000000e+01 -3.40793832e+02 7.70654439e+01 4.32489271e+02] [ 0.00000000e+00 -1.83258422e+02 0.00000000e+00 4.35042329e+02 1.00000000e+00 -2.69141438e+02 -2.63085301e+01 4.33436573e+02 2.00000000e+00 -3.22843989e+02 -2.29503814e+02 2.33351408e+02 3.00000000e+00 -2.49089056e+02 -4.25338906e+02 6.22366608e+01 6.00000000e+00 -9.62222365e+01 2.63084252e+01 4.36699491e+02 7.00000000e+00 2.24034193e+01 -2.61309875e+02 2.67618882e+02 8.00000000e+00 1.54367858e+02 -6.31257693e+02 9.03736198e+01 1.20000000e+01 -2.61708369e+02 1.33295168e+02 5.65445867e+02 1.30000000e+01 -3.04922756e+02 2.29288790e+02 7.71281611e+02 1.40000000e+01 -2.96671126e+02 2.02390012e+02 8.17524615e+02 1.50000000e+01 -3.07083062e+02 2.14911454e+02 9.32979488e+02 1.70000000e+01 -1.77740030e+02 2.52453124e+02 7.47383699e+02 1.80000000e+01 -5.13091565e+01 3.06488767e+02 5.32897207e+02 1.90000000e+01 -1.01079298e+02 2.30852746e+02 4.52905218e+02 2.50000000e+01 -4.08161902e+02 1.81778994e+02 7.14943214e+02 2.60000000e+01 -4.25635673e+02 1.94786673e+02 5.55817881e+02 2.70000000e+01 -3.48699766e+02 7.13981633e+01 4.32973785e+02] [ 0.00000000e+00 -1.83258422e+02 0.00000000e+00 4.31083807e+02 1.00000000e+00 -2.69222069e+02 -2.51180607e+01 4.33332432e+02 2.00000000e+00 -3.25934704e+02 -1.93407339e+02 2.28108064e+02 3.00000000e+00 -2.53702770e+02 -3.59127786e+02 4.89225389e+01 6.00000000e+00 -9.61937860e+01 2.51179491e+01 4.28834547e+02 7.00000000e+00 2.26103472e+01 -2.26777670e+02 2.62561894e+02 8.00000000e+00 1.03039696e+02 -5.54336616e+02 7.45365438e+01 1.20000000e+01 -2.61985829e+02 1.01464378e+02 5.71669076e+02 1.30000000e+01 -3.00941255e+02 1.74065238e+02 7.62925999e+02 1.40000000e+01 -2.95097294e+02 1.52275750e+02 8.06767647e+02 1.50000000e+01 -3.00980505e+02 1.60668815e+02 9.19519559e+02 1.70000000e+01 -1.75369209e+02 1.95730923e+02 7.31062363e+02 1.80000000e+01 -5.05824393e+01 2.45493816e+02 5.36234879e+02 1.90000000e+01 -1.00288191e+02 1.97739569e+02 3.96829745e+02 2.50000000e+01 -4.03172572e+02 1.30661343e+02 7.15751303e+02 2.60000000e+01 -4.18310200e+02 1.22591605e+02 5.59694285e+02 2.70000000e+01 -3.44089298e+02 1.75666075e+01 4.85209573e+02]
エラー
ValueError: could not convert string to float: '769.1499183532123,'
txtファイルと同様の形式のものを他のtxtファイルで読み込むとエラーとなります.
上記とコードは同様で形式も数値が異なるだけとなっています.
初歩的な問題で申し訳ありませんがよろしくお願い致します.