1. Write data to the CSV file, you should be able to directly implement the Python code to write the dataset, but I read this piece of file is not very skilled, and so I succeeded, plus, here I write the dataset directly into Excel
2. Then change the suffix to. csv and use Pandas to read
Import Matplotlib.pyplot as Pltfile = ' bp_test.csv ' import pandas as Pddf = pd.read_csv (file, header=none) x = df.iloc[:,].v Aluesprint (x)
Read results
[ -1. -0.9602] [ -0.9 -0.577] [ -0.8 -0.0729] [ -0.7 0.3771] [ -0.6 0.6405] [ -0.5 0.66 ] [ -0.4 0.4609] [ -0.3 0.1336] [ -0.2 -0.2013] [ -0.1 -0.4344] [0. -0.5 ] [0.1 -0.393] [0.2 -0.1647] [0.3 0.0988] [0.4 0.3072] [0.5 0.396] [0.6 0. 3449] [0.7 0.1816] [0.8 -0.0312] [0.9 -0.2189] [1. -0.3201]]
3. Visualize 21 of your data
Plt.scatter (x[:,0], x[:,1], color= ' red ', marker= ' x ', label= ' Mark ') Plt.xlabel (' x ') Plt.ylabel (' Y ') plt.legend (loc= ') Upper left ') plt.show ()
Run results
Python constructs BP single-layer neural network __1. Visualizing data