• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

About me

Let me introduce myself


A bit about me

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

I have more than 5 years’ experience related to manufacturing of optical design ,Camera Module and also have some experience on coding . Having years of RD experience that cooperated with international ODM/OEM partners and optics-mechanical products development/DataAnalysis/research/process.

Profile

Deepak Bhagya

Personal info

Deepak Bhagya

If I have seen further than others, it is by standing upon the shoulders of giants.

Birthday: 21 Dec 1984
Phone number: +886
Website: https://bobobo746.blogspot.com
E-mail: 2dkjd1k@gmail.com

RESUME

Know more about my past


Employment

  • 2016-future

    https://www.ixensor.com/ix_web/ @ Optical-Software Programmer

    Optical-Signal algorithm and analysis: 1). Using smart phone’s front camera as optical-analysis device to observe color signal change. 2). Color signal change is based on the blood reacts with strips. 3.) By those signal change, trying to figure out a curve line to represent the bio-reacts on strips and use those feature to construct a measurement system. 4.) Trying to improve the bias, accuracy and precision. 5.) Issues fixed. Image process algorithm: 1.) Image Recognition: Analysis the image to make sure whether the optical device’s uniformity is qualified or not. Experiment Data Build: 1.) Using SQL to build Database for Experiment data. 2.) Producing API for co-workers to access and get some data source, reducing the data collecting time. 3.) Maintaining data base and trying to improve data schemas.

  • 2013-2016

    http://www.primax.com.tw/ @ Sr.Optical and Software Engineer

    1). Camera lens optical specifications define and analysis optical issue, likes the Flare, MTF(SFR), Alignment, Optical Center, and NG-sample analysis. 3). Lens focusing image recognition: Programming an application for machine to recognize the image and focus lens. 4). Con-call and report to customer, and vendor management.

  • 2010-2013

    www.Ledlink.com @ Optical Engineer

    1/ LED lighting lens module development, LED module development of TV backlight, new module development and spec. define. 2/ Optical design of LED lighting lens, jigs design, and solve process problems. 3/ Precision process development, new film materials analysis. 4/ New patent application . 5/ Optical simulation analysis

Education

  • 2006-2009

    University of NCUE @ graduated

    bachelor of science (physics)

  • *********.

Skills & My Love

Engineer
80%
software
WorkOut
91%
Fitting
Coding
95%
Python

Portfolio

My latest projects


顯示具有 dataframe 標籤的文章。 顯示所有文章
顯示具有 dataframe 標籤的文章。 顯示所有文章

2017年3月13日 星期一

Pandas Dataframe 語法


import pandas as pd
import numpy as np

                        pandas dataframe API
        pandas.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False)
# attribute:(.即可)
'''DataFrame.size # 資料總數
  .shape # 幾乘幾的dataframe
  .values # 把 dataframe 轉成 2維 array
  .ndim # 維度
  .T # 轉置
  .dtypes # data types(看是整數還浮點數)
  .axes # 查看 index 跟 columns 名稱
  .ix # Lable 在該index 對應的資料,可以放index數字也可以放label文字 
  .loc # Lable 在該index 對應的資料 (只能放label文字 )
  [] # 第一個中括號,看columns的資料內容 ,後面補上的第二個括號是該columns對應的label
  .insert()# 插入:.insert(要插在第幾個column位置,安插的名稱,安插資訊內容)
'''            
df = pd.DataFrame(np.random.rand(4,3),index=['a','b','c','d'],columns =['A','B','C'])
print df.size
print df.shape
print df.values
print df.ndim
print df.dtypes
print df.axes
print df.ix[0]
print df.ix['a']
print df.loc['a']
print df['A']['a']

# method:(.小括號)
df = pd.DataFrame(np.random.randn(4,3),index=['a','b','c','d'],columns =['A','B','C'])
df2= pd.DataFrame(np.random.randn(4,1),index=['w','x','y','z'],columns =['A'])
'''
DataFrame
  <合併刪除>
  .add(other, axis='columns') # data相加,但是一定要columns名稱相同
  .append(other, ignore_index=False ) # 新增資料合併用,雷同merge
  .merge(right,how='inner') # 新增資料合併用 找相同columns然後從下面補上去,預設為交集(inner,可改為outer聯集
  .join(other,how='left') # 新增資料合併用,left:以原資料為主,other為新增,right則相反)
  .drop(labels) # 剔除label資料 (刪除columns: del df[] 沒有.點)

  <數值計算>
  .describe() # 幫忙計算資料的數量, mean, std,cv...等等
  .abs() # 絕對值
  .idxmax(axis) # 比較大小(依照axis :0就是ABC比,順序:橫向 1就是abcd比,順序:直立)
  .idxmin(axis)
  .mean(axis) # axis=0 A平均B平均C平均;axis=1 a平均b平均c平均d平均
  .min(axis) # axis=0 找A最小B最小C最小;axis=1 找a最小b最小c最小d最小
  .round([decimals]) # 取小數點幾位
  .std(axis=None) # 計算std ,依照指定的axis =0 或1
  .sum(axis= None) # 計算sum ,依照指定的axis =0 或1

  <獲取,查看資料>
  .get_values() # 等同於DataFrame.values
  .head(n) # 只列出前n列的資料 沒寫就是前五列
  .keys() # 只查看columns名稱

  <修改欄位>
  .reset_index(drop=True) # 如果今天index的lable順序因為合併變成雜亂,可以用這個重新從0開始排序(要寫true不然原先的index會留著)       
  .rename(index={ },columns= { }) # label與columns命名修改
  .swapaxes(axes1,axes2) # column ,index 互換
  .transpose() # column ,index 互換

  <修改內容>
  .df.shift(periods=1,axis=0) # shift,perios看要移動幾格, axis 看是移動直向還是橫向
  .set_value(index,col,value) # 設定資料內容, index,column都要是label value為要設定的資訊
  .sort_values(by=[],axis=0) # axis=0 依照ABC欄位去做abcd排序 by要填入column的label即A,B,C ,axis=1則相反 .  

  <存檔格式>
  .to_csv('.... .csv') # 轉成csv檔 改路徑就直接把路徑寫出最後補上.csv即可 (用pd.read_csv()讀檔案)
  .to_pickle('.... .pickle') # 轉成pickle檔 改路徑就直接把路徑寫出最後補上.pickle即可
  .to_json('.... .json') # 轉成json string檔 改路徑就直接把路徑寫出最後補上.json即可

  <更新>
  .update(other[]) # 更新other[] 中括號裡面上的是要更新column的lable。更新要確認index是否相同 否則更新無效     
'''     
print df
print df2
print df.append(df2,ignore_index =True)
print df.describe()
print df.drop('a')
print df.get_values()
print df.head(2)
print df.idxmax(0)
print df.idxmax(1)

#######移動shift 且新增資訊方式:
df3 =df.shift(axis=1)
print df3
val =[10,20,30,40]
label= ['a','b','c','d']     
for index,i in enumerate (val):
  df3 =df3.set_value(index =label[index],col='A',value=i)
print df3
########
print df.sort_values(by=['a','b','c','d'],axis=1)

pandas, series 其他語法

# dot 用法 : 矩陣相乘
s1 = pd.Series(np.arange(1,5)) 
s1.dot(s1)

# series- dictionary用法:
d ={'one':pd.Series([1,2,3],index=['a','b','c']),
  'two':pd.Series([4,5,6],index=['d','e','f']) }
print (d['one'])
df= pd.DataFrame(d)
print
print (df)
print
print(pd.DataFrame(d,index=['b','c','f']))

# list-dictionary用法:
t= [{'a':10, 'b':20},{'a':5,'b':300,'c':1}]
pd.DataFrame(t)

# DataFrame.from_item 用dictonary來幫dataframe的column命名:
df= pd.DataFrame.from_items([('a',[1,2,3]),('b',[4,5,6])])
print(df)
print
print(df.T)

# DataFrame.from_item 用dictonary方式來命名, 但加了orient就變成轉置只是強制要幫column命名:
df= pd.DataFrame.from_items([('a',[1,2,3]),('b',[4,5,6]),('c',[7,8,9]),('d',[10,11,12])],
  orient='index',columns=['one','two','three'])
df

# 可以做運算 也可以用flag做布林值判定
df['three'] =df['one']*df['two']
df['flag']= df['one']>2
df

# 刪除整個columns就 del (刪除整個index 用drop)
del df['three']
df

# 新增欄位直接寫要的欄位名稱 ,不過index內容全部統一(除非用condat合併才可以放入其他資訊)
df['date'] = '2017-03'
df

# 插入:insert(要插在第幾個column位置,安插的名稱,安插資訊內容)
df.insert(4,'james gordan',df['one'])
df

# 從欄位找資料:
print (df['one'])
print 
# 用loc,從 lable找資料 (也可以用iloc用index找資料):
print (df.loc['a']) # Same as : df.iloc[0]

# 切片用法:在df是切片用法,即切片起始0在空的lable那裏,所以a是1, 1:3 取兩個,頭不算 所以取2,3
df[1:3] # 與 d[:3]:從頭開始取到第3個不同含義

pandas concat 合併語法
pandas.concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, keys=None, levels=None, names=None)
# concat 兩個dataframe做合併 依照aixs軸設定 ,是新創的記憶體位置
df = pd.DataFrame(np.random.randn(4,3),index=['a','b','c','d'],columns =['A','B','C'])
df2= pd.DataFrame(np.random.randn(4,1),index=['w','x','y','z'],columns =['D'])
pd.concat([df,df2],ignore_index='True',axis=0)










這封郵件來自 Evernote。Evernote 是您專屬的工作空間,免費下載 Evernote

Services

What can I do


Branding

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Web Design

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque.

Graphic Design

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Development

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Photography

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

User Experience

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com