일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- matplotlib
- string
- Kotlin
- PANDAS
- SQL
- list
- Github
- PySpark
- PostgreSQL
- array
- c#
- Excel
- Python
- 파이썬
- Mac
- gas
- Tkinter
- Redshift
- numpy
- Google Spreadsheet
- Java
- django
- hive
- google apps script
- dataframe
- Apache
- math
- Google Excel
- GIT
- Today
- Total
목록sort (3)
달나라 노트
Sort method는 Array를 정렬해줍니다. using System; class MyProgram { static void Main() { string[] test_arr = { "Pineapple", "Banana", "Apple", "Grape" }; Array.Sort(test_arr); foreach (string t in test_arr) { Console.WriteLine(t); } } } -- Result Apple Banana Grape Pineapple test_arr은 무작위로 array 속 요소들이 존재합니다. 여기에 Array.Sort를 적용하면 test_arr 속 요소들이 알파벳 기준 오름차순으로 정렬됩니다. using System; class MyProgram { stati..
Excel에서 sort 함수는 특정 범위를 지정하여 해당 범위의 데이터를 내가 원하는 컬럼을 기준으로 오름차순 또는 내림차순하여 데이터를 나타내줍니다. =sort(range, column_num, asc/desc) 위처럼 사용할 수 있습니다. range : 정렬할 원본 data가 담긴 셀 범위입니다. column_num : 정렬 시 기준이 될 column의 번호를 입력해줍니다. range에서 명시된 셀 범위 기준 가장 첫 행은 1, 두 번째 행은 2 이런식입니다. asc/desc : 오름차순 정렬을 할건지 내림차순 정렬을 할건지에 대한 값입니다. 1은 오름차순이며 -1은 내림차순입니다. 엑셀에 위와같은 표가 있다고 합니다. 그런데 어느 컬럼 하나도 정렬되어있지 않고 데이터가 중구난방으로 적혀있습니다. 이..
sorted, sort 모두 python의 list 속 요소들을 정렬할 수 있습니다. list_test = [5, 3, 1, 4, 2] list_test.sort(reverse=False) print(list_test) list_test = [5, 3, 1, 4, 2] list_test.sort(reverse=True) print(list_test) -- Result [1, 2, 3, 4, 5] [5, 4, 3, 2, 1] 먼저 sort method를 봅시다. 위처럼 어떤 list에 적용하여 sort가 적용된 list 자체를 정렬시켜버립니다. (sort method는 적용된 list 자체에 변형을 가하고 아무 return값이 없습니다.) 또한 reverse라는 option을 명시하여 오름차순/내림차순 정..