Python数据分析-1

第一次用python进行数据分析,速度很快很强大



# -*- coding: utf-8 -*-

"""
Created on Thu Sep 22 11:39:29 2016


import numpy as np
import pandas as pd
import matplotlib.pyplot as plt


yindex=np.arange(10,1510,10)
xindex=np.arange(0,1824.4,0.4)


df = pd.read_excel("meshdata.xls",header=None,names=yindex)
df.index=xindex
fig=plt.figure(figsize=(20,10))
ax=fig.add_subplot(111)
#plt.plot(df.index,df.loc[:,[10,20,30,40,50,60]])
#plt.legend(['10mm','20mm','30mm','40mm','50mm','60mm'])
plt.plot(yindex,df.loc[[0.4,900,1200,1800],:].T)
plt.grid()
plt.xlabel("Y Position(mm)")
plt.ylabel("Floating Height(mm)")
plt.title("Floating Height along Y-axis")
plt.legend(['0.4mm','900mm','1200mm','1800mm'])
plt.xlim(-20,1600)
plt.xticks(np.arange(-100,1700,100))


x_center=[]
for i in range(12):
    x0=62.5
    stroke=160
    x_center.append(125*i+x0)
    y0=0.035 if i%2==0 else 0.04
    
    x=[x_center[i]-stroke/2,x_center[i]+stroke/2]
    y=[y0,y0]
    optics=plt.plot(x,y)
    plt.setp(optics,linewidth=5.0)
plt.plot([750,750],[0,0.09],'g--')



plt.show()
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值