본문 바로가기

참고문서(번역?)

(7)
10분만에 끝내는 pandas (출처: https://pandas.pydata.org/pandas-docs/stable/10min.html#min)< 아래내용을 jupyter notebook으로 실행한 파일을 첨부하였습니다. 환경이 되는 분은 활용하시기 바랍니다) 10 Minutes to pandas이 문서는 pandas에 대한 간단한 소개이며, 처음 접하는 사용자를 위한 것이다. 더 복잡한 조리법(?)은 Cookbook을 보시기 바랍니다. Customarily, we import as follows:In [1]: import pandas as pd In [2]: import numpy as np In [3]: import matplotlib.pyplot as plt Object CreationSee the Data Structure..
__slots__ 3.3.2.3. __slots__By default, instances of classes have a dictionary for attribute storage. This wastes space for objects having very few instance variables. The space consumption can become acute when creating large numbers of instances.The default can be overridden by defining __slots__ in a class definition. The __slots__ declaration takes a sequence of instance variables and reserves just en..
PEP 3102 -- Keyword-Only Arguments keyword-only argumentsPEP 3102 -- Keyword-Only ArgumentsPEP:3102Title:Keyword-Only ArgumentsAuthor:Talin Status:FinalType:Standards TrackCreated:22-Apr-2006Python-Version:3.0Post-History:28-Apr-2006, May-19-2006ContentsAbstractRationaleSpecificationFunction Calling BehaviorBackwards CompatibilityCopyrightAbstractThis PEP proposes a change to the way that function arguments are assigned to named ..
__repr__() vs. __str__() Python에는 문자열관련 special method가 두개가 있습니다.__str__()과 __repr__()[공식문서의 내용을 볼까요?]__repr__()object.__repr__(self)Called by the repr() built-in function to compute the “official” string representation of an object. If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment). If this is not possible,..
python은 함수도 이름으로 취급 Python은 개발자를 골탕 먹이기 위한 언어일 지도 ㅠㅠdef square(x):return x*xdef cube(x): return x*x*xfuncs = {"square": square,"cube": cube}이렇게 정의해 놓고 다음과 같이 씁니다. 뭔가 이상한 것을 발견한 분 없나요? ^^x = 2square(x)cube(x)for func in sorted(funcs):print(func, funcs[func](x))위의 코드를 실행하면 다음과 같이 나옵니다.48 cube 8 square 4그래서 다음을 중간에 찍어봅니다.print(funcs.items()) [수행결과]dict_items([('square', ), ('cube', )])즉 함수를 정의하고 함수명을 변수로 넣으면 마치 변수처럼 취..
Models: 데이터베이스와 연결하는 넘 두 번째 번역 중인 글입니다.이제는 머리가 안돌아가서... 이렇게라도 하면 좀 익혀질까 하는 생각이 드네요.. ^^ 처음 번역한 문서에 링크가 되어 있는 것들을 하나씩 추가로 해보려고 합니다.출처: Django 공식싸이트의 어떤 문서(https://docs.djangoproject.com/en/1.10/topics/db/models/)한번 시작해 볼까요? 저작권에 문제가있다면 바로 삭제하겠습니다.번역은 기냥 제가 편한데로... 어떨 땐 의역, 어떨 땐 직역 ^^불편하더라도 양해 바랍니다. 모델¶model이란 데이터를 정의하는 정보를 담고 있는 모듈이다. 이 것은 필수 필드와 데이터 조작에 대한 정의을 포함하고 있다. 일반적으로 각 모델은 단일 데이터베이스 테이블과 매핑된다.기본 사항:각 각의 모델은 Py..
Django로 DB 건들이기가 쉬운겨? ^^ 출처: Django 공식싸이트의 어떤 문서(https://docs.djangoproject.com/en/1.10/intro/overview/)한번 시작해 볼까요? 저작권에 문제가있다면 바로 삭제하겠습니다.번역은 기냥 제가 편한데로... 어떨 땐 의역, 어떨 땐 직역 ^^불편하더라도 양해 바랍니다. 한눈에 보는 Django¶Django는 아주 빠른 속도로 뉴스룸 같은 환경(여러 개의 기사 후보 중에서 급하게 인쇄될 기사를 선정하고 기사를 작성하는 정신 없이 바쁜?)에서 개발되었기 때문에, 공통의 웹개발 작업을 빠르고 쉽게 하도록 설계되었다. 이 글은 Django를 가지고 데이터베이스 위주의 웹 앱을 작성하는 비공식 개요입니다.이 문서의 목적은 Django가 어떻게 작동하는지에 대한 충분한 기술적인 스펙을 ..