얼렁뚱땅 스며드는 Data Science

전체 글 120

[Colab] google colab에서 zip파일 압축풀기

이번에 새롭게 캐글 컴피티션에 참가하면서 이번에는 kaggle API를 꼭 써보겠다 마음먹었는데.... 데이터 파일이 너무 커서 그런지 다운이 안되더라구요.... 더 찾아보기 귀찮아서 결국 dataset을 직접 다운받고 google colab에서 압축을 풀었습니다! 그럼 google colab에서 압축파일 푸는 법을 알려드릴께요! 1. google drive에서 새로운 google colab파일을 연다. 2. 드라이브를 mount한다. 3. cd "/content/drive/파일 위치.../" 4. !zip -qq "/content/drive/파일 위치.../data.zip" 저는 이게 편해서 이제 이렇게 써야겠어요. submission할때만 kaggle API쓸꺼야! 흥!

etc 2021.11.08

[Leetcode] Median : Find First and Last Position of Element in Sorted Array

Description Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. My Solution class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: from bisect import bisect_left, bisect_right if target..