1. Pansas

  • Python packages for data structures and data analysis/processing
  • Utilizing the fundamental data structures Series and DataFrame.

 

2. Series

  • Pandas data structure that holds both index and value formats
  • Series is distinct from a list containing only values due to its composition of index and value
  • Index is automatically generated with default values of 0, 1, 2, 3, ...

 

3. Example

 

 

4. DataFrame and loading data files

  • Loading CSV file: pd.read_csv('filename.csv')
  • Loading Excel file: pd.read_excel('filename.xls(x)')
  • [한글 파일 불러오기 -> csv] : pd.read_csv('파일명.csv', encoding='euc-kr')
  • [한글 파일 불러오기 -> excel] : pd.read_excel('파일명.xls(x)', encoding='euc-kr')
  • Confirming the same directory path

 

 

 

 

 

 

 

 

  • Adding columns (variables) to the dataset (variable calculation):
    • df['input name'] = df['name'] * 1.1
    • df.insert(8, 'input name', df['name'] * 12)
  • Deleting columns (variables) from the dataset:
    • del df['name']
    • del df['name2']
  • Extracting specific group data

  • Extracting data above or below a certain threshold value.

320x100

'Computer > Python & Machine learning' 카테고리의 다른 글

3. Numpy  (0) 2024.04.06
2. Install python packages  (0) 2024.04.05
1. Install Anaconda  (0) 2024.04.05

+ Recent posts