代码
import matplotlib.pyplot as plt
import numpy as np
filename='E:\1Documents\pmodlh\antenna and instrument\20170627-20180630\Cool_Temp_20170627.dat'
x,y,z,m=[],[],[],[]
with open(filename,'r') as f:
lines=f.readlines()
for line in lines:
value=[float(s) for s in line.split()]
x.append(value[0])
y.append(value[1])
z.append(value[2])
m.append(value[3])
print x
File "C:\Users\Administrator\Documents\Python Scripts\data_plot.py", line 7
for line in lines:
^
ndentationError: unexpected indent
解决方法:
notepad++
视图——显示符号——显示空格与制表符,TAB键对齐。
注:python 对缩进有严格的要求。