Code Monkey home page Code Monkey logo

pandas's Introduction

Python_data

검색 기능

  • Y = df['columns].str.contains("str") columns 에 str을 포함한 행 찾기

  • X = df[Y] # y조건에 해당하는 행들만 추출

  • df.isin([str, num]) str, num을 포함한 행 찾기

  • 2 열을 검색

              df_search = df['col_1'].str.contains(search_text)
              df_search2 = df['col_2'].str.contains(search_text)
              self.DF = df[df_search | df_search2]
    

조건 검색

  • DataFrame[(DataFrame[Column's_name] == x) & (DataFrame[Column's_name_2] == y)]

  • DataFrame[['column1', 'column2']][DataFrame['column1'] == 1].mean

  • DataFrame의 column1,column2를 추출하는데, DataFrame의 column1이 1인 값들만을 추출해서 평균을 냄

정렬

  • data = data.sort_values(["column"], ascending=[False])
  • data = data.reset_index(drop=True) 인덱스 재정렬

boxplot 극단치 제거

column name 변경

  • DataFrame.rename(columns={'original name1':'new name1', 'original name2':'new name2', 'original name3':'new name3'}, inplace=True)
  • DataFrame.rename(columns=lambda x: x[0:3], inplace=True) # 4글자로 줄이기
  • DataFrame.rename(index={0:'zero',1:'one'}, inplace=True) # index의 이름을 zero, 1로 바꾸기

index로 merge

  • data = pd.merge(data, data_1, how = 'inner', left_index = True, right_index = True)

깃허브에서 주피터노트북 로드가 되지 않을 때

nbviewer의 url에서 주피터 노트북 파일이 올려져 있는 깃허브 url을 합친다.

https://nbviewer.jupyter.org

깃허브 사이트의 url

https://github.com/SUDON-NOH/Python_data/blob/master/matplotlib_basic.ipynb

  • 결과

https://nbviewer.jupyter.org/github/SUDON-NOH/Python_data/blob/master/matplotlib_basic.ipynb

isin or is not in 사용법

df_is = df['column'].isin('str or list') df_isnotin = ~df['column'].isin('str or list')

https://biopython.org/DIST/docs/api/Bio.Entrez-module.html

pandas's People

Contributors

sudonnoh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.