import matplotlib.pyplot as plt
import pandas as pd
import scipy.integrate as integrate
import math
import sympy
def excel_one_line_to_list(input_line):#fun1
df = pd.read_csv("C:/Users/ljj773888/Desktop/python_code/Data1.csv", usecols=[input_line],
names=None) # 读取项目名称列,不要列名
df_li = df.values.tolist()
result = []
for s_li in df_li:
result.append(s_li[0])
return result
def double_integral_data(data_to_calculate):#fun2
data_to_save=[]
for num in data_to_calculate:
result=num*0.005*0.005
data_to_save.append(result)
return data_to_save
def form_the_grath(data_to_operate_x,data_to_operate_y):
plt.style.use('seaborn')
fig,ax = plt.subplots()
ax.scatter(data_to_operate_x,data_to_operate_y,s=1)
ax.tick_params(axis='both',which='major',labelsize=14)
ax.axis([0,0.1,0,0.9000])
plt.show()
if __name__ == '__main__':
fun1_result_ax=excel_one_line_to_list(1)
fun1_result_time_as_x_values=excel_one_line_to_list(2)
fun2_result=double_integral_data(fun1_result_ax)
form_the_grath(fun1_result_time_as_x_values,fun1_result_ax)
|