반응형

https://sdc-james.gitbook.io/onebook/

 

한곳에서 끝내는 파이썬 & 머신러닝 & 딥러닝 - OneBook(Python & Deep Learning)

이 문서는 초보자들이 쉽게 딥러닝 및 파이썬을 공부하기 위해 만든 문서 입니다. 제가 이 공부를 체계없이 시작하여 많은 오류를 범하였고, 또한 이곳 저곳을 돌아다니며 여러 자료들을 참고

sdc-james.gitbook.io

이 문서는 초보자들이 쉽게 딥러닝 및 파이썬을 공부하기 위해 만든 문서 입니다. 제가 이 공부를 체계없이 시작하여 많은 오류를 범하였고, 또한 이곳 저곳을 돌아다니며 여러 자료들을 참고 하느라 많은 시간이 걸려서 다른 분들은 한곳에서 쉽게 접근 할 수 있도록 제 나름대로 체계를 잡은 것입니다.
제 지식이 미천하여 많은 내용 오류가 있습니다. 오류에 대한 지적은 권경혁( onebook2james@gmail.com )로 이메일을 주시면 성실히 답하겠습니다. 또한 여러 싸이트에서 발췌한 자료가 많이 있습니다만 제가 정리하면서 원본 인용 표기가 누락된 곳도 있을 것이니 양해해 주시기 바랍니다.
 
계속 읽으시려면 아래 → 화살표를 누르시면 됩니다.
 
이 문서는 GitBookGitHub 에서 읽을 수 있습니다.
반응형

'프로그래밍 > Python' 카테고리의 다른 글

[python] matplotlib - pip install matplotlib  (0) 2023.07.09
[python] 점프 투 파이썬 book  (0) 2023.07.07
[python] iPad에서 파이썬 하기  (0) 2023.07.04
[python] pandas get started  (0) 2023.06.11
[python] simple-colors  (0) 2023.06.09
반응형

[python] iPad에서 파이썬 하기

https://apps.apple.com/kr/app/carnets-jupyter/id1450994949

 

‎Carnets - Jupyter

‎Jupyter notebooks are a powerful tool used in education and research. You can write small snippets of Python code and observe the result on screen, combine with paragraphs of text, using Markdown. Carnets provides a complete, stand-alone, implementation

apps.apple.com

Jupyter 노트북은 교육 및 연구에 사용되는 강력한 도구입니다. Python 코드의 작은 스니펫을 작성하고 Markdown을 사용하여 화면에서 결과를 관찰하고 텍스트 단락과 결합할 수 있습니다.

Carnets는 Jupyter 노트북의 완전한 독립 실행형 구현을 제공합니다. 임베디드 Python 인터프리터를 사용하여 모든 것이 장치에서 실행됩니다. 인터넷 연결이 필요하지 않습니다. 설정을 사용하여 Jupyter 노트북과 고급 Jupyterlab 중에서 선택할 수 있습니다.

 

Numpy, Sympy, Matplotlib, Pandas, lxml, bokeh, nbextensions(ipywidgets 포함) 및 기타 여러 패키지가 사전 설치되어 있습니다. 설치된 패키지의 전체 목록을 보려면 코드 창에 "%pip list"를 입력하십시오. "%pip install packageName"을 사용하여 더 많은 패키지를 추가할 수 있지만 순수 Python인 경우에만 가능합니다.

 

scipy, seaborn 또는 scikit-learn이 필요한 경우 다른 앱인 "Carnets - Jupyter(with scipy)"를 사용하십시오.

 

다른 앱과 노트북을 공유하고 다른 앱에서 관리하는 노트북이나 디렉토리를 열 수도 있습니다.

 

설치된 패키지의 일부 목록: astropy, babel, bokeh, cryptography, cvxopt, Fiona, geopandas, geopy, lxml, matplotlib, numpy, openCV, pandas, pillow, pyFFTW, pyproj, rasterio, regex, shapely, sympy, wordcloud.

 

 

https://apps.apple.com/kr/app/pythonista-3/id1085978097

 

‎Pythonista 3

‎Pythonista is a complete scripting environment for Python 3.10, running right on your iPad or iPhone, so you can develop and run Python scripts on the go. Like Python itself, "batteries are included" – from popular third-party modules like requests, n

apps.apple.com

Pythonista는 iPad 또는 iPhone에서 바로 실행되는 Python 3.10을 위한 완벽한 스크립팅 환경이므로 이동 중에도 Python 스크립트를 개발하고 실행할 수 있습니다.

Python 자체와 마찬가지로 요청, numpy, matplotlib, pandas(및 기타)와 같은 인기 있는 타사 모듈에서 iOS용으로 맞춤 제작된 모듈에 이르기까지 "배터리가 포함되어 있습니다". Pythonista를 사용하면 스크립트에서 센서/위치 데이터, 사진 라이브러리, 연락처, 미리 알림, 클립보드 등에 액세스할 수 있으므로 Python과 iOS의 잠재력을 최대한 활용할 수 있습니다.

 

Pythonista는 사용자 친화적인 인터페이스로 설계되어 기술 수준에 관계없이 누구나 쉽게 코딩을 시작할 수 있습니다. 전체 Python 설명서는 앱에서 오프라인으로 읽을 수도 있습니다.

 

Pythonista는 Python을 배우고 연습하기 위한 것일 뿐만 아니라 여러 앱 확장으로 iOS를 자동화하는 강력한 도구이기도 합니다. 거의 모든 앱의 공유 시트 또는 사용자 지정 시스템 키보드에서 직접 스크립트를 호출하고 스크립트를 Shortcuts 및 Siri와 통합할 수 있습니다. Pythonista를 사용하면 다른 앱 간에 전환할 필요 없이 필요할 때마다 스크립트를 쉽게 실행할 수 있습니다.

 

특징:

 

> 구문 강조 표시, 코드 완성 및 스크립팅 지원 기능이 있는 강력한 코드 편집기

 

> 코드 완성, 명령 기록 및 이미지 표시 지원이 포함된 대화형 프롬프트

 

> 통합 시각적 디버거 및 개체 검사기

 

> 편집기에서 직접 빠르게 조회하여 오프라인 문서 작성 완료

 

> 다양하고 아름다운 명암 테마와 나만의 테마 편집기

 

> 빠른 프로토타이핑을 위한 UI 편집기

 

> 통합 PEP 8 스타일 검사기 및 코드 포맷터

 

> 대부분의 Python 표준 라이브러리와 그래픽, 사운드 및 iOS 통합을 위한 추가 모듈(예: 클립보드, 연락처, 미리 알림, 사진, UI...)을 지원합니다.

 

> 요청, numpy, matplotlib, pandas, Pillow...와 같은 많은 인기 있는 타사 모듈 포함

 

> 포함된 많은 예제

 

> iPad 및 iPhone용 범용 앱

 

> 거의 모든 앱에서 스크립트를 실행할 수 있는 공유 시트 확장

 

> 텍스트를 편집하는 모든 앱에서 Python을 사용하기 위한 스크립팅 가능한 시스템 전체 키보드

 

> 바로 가기 앱과의 고급 통합으로 Python 스크립트를 바로 가기 및 개인 자동화 작업으로 사용할 수 있습니다.

 

Pythonista는 컴파일된 언어(C/C++)로 작성된 추가 모듈을 설치하거나 다운로드할 수 있도록 설계되지 않았습니다. 널리 사용되는 많은 네이티브 라이브러리가 포함되어 있고 기본적으로 작동하지만 일반적으로 C/C++ 종속성이 있는 추가 모듈을 설치할 수 없습니다.

 

"Pythonista"라는 이름은 Python Software Foundation의 승인을 받아 사용됩니다.

반응형
반응형

Pandas Tutorial

https://www.w3schools.com/python/pandas/default.asp

 

Pandas Tutorial

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

Pandas is a Python library.

Pandas is used to analyze data.

 

https://pypi.org/project/pandas/

pip install pandas

 

 

pandas

Powerful data structures for data analysis, time series, and statistics

pypi.org

 

Pandas   http://bigdata.dongguk.ac.kr/lectures/Python/_book/pandas.html#pandas-dataframe

  • 데이터 처리와 분석을 위한 라이브러리
  • 행과 열로 이루어진 데이터 객체를 만들어 다룰 수 있음
  • 대용량의 데이터들을 처리하는데 매우 편리
  • pandas 자료구조
    • Series: 1차원
    • DataFrame: 2차원
    • Panel: 3차원
  • pandas 로딩
    • import numpy as np # 보통 numpy와 함께 import
    • import pandas as pd
""" Pandas Tutorial
https://www.w3schools.com/python/pandas/default.asp

Pandas is a Python library.
Pandas is used to analyze data.
"""

#import pandas
import pandas as pd #Now the Pandas package can be referred to as pd instead of pandas.


mydataset = {
  'cars': ["BMW", "Volvo", "Ford"],
  'passings': [3, 7, 2]
}

myvar = pd.DataFrame(mydataset)

print(myvar)


import pandas as pd
print(pd.__version__)
반응형
반응형

simple-colors 

https://pypi.org/project/simple-colors/

 

simple-colors

Colorful output in terminal

pypi.org

 

#Colored Output in Python
import simple_colors
text = "Welcome to Python"

# Colored text
colored = simple_colors.blue(text)
print('Colored:', colored)

# Colored and Bold text
bold_colored = simple_colors.green(text,'bold')
print('BOLD:', bold_colored)

# Colored, Bold and Underlined text
attributes = ['bold','underlined']
bold_underlined = simple_colors.red(text, attributes)
print('BOLD and Underlined: ', bold_underlined)

Project description

Simple Colors

Colorful output in terminal.

Installation

pip install simple-colors

Usage

from simple_colors import *

print(green('hello'))
print(green('hello', 'bold'))
print(green('hello', ['bold', 'underlined']))

Inlucded colors

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan

Included styles:

  • bold
  • bright
  • dim
  • italic
  • underlined
  • blink
  • reverse
반응형
반응형

https://wikidocs.net/book/1704

공학자를 위한 Python

 

반응형
반응형

[python] 스파이더, https://www.spyder-ide.org/

 

Home — Spyder IDE

Download Ready to give Spyder a try? Let's get started! Want to join the community of scientists, engineers and analysts all around the world using Spyder? Click the button below to download the suggested installer for your platform. We offer standalone in

www.spyder-ide.org

 

https://wikidocs.net/15313

 

1.2.2 Spyder

Spyder는 Anaconda 배포본에 포함되어 있는 IDE이다. 에디터와 콘솔을 지원하기 때문에 위의 작업을 편하기 수행할 수 있다. 또한, 프로젝트, 디버깅, 헬프, 변수 보…

wikidocs.net

https://docs.spyder-ide.org/current/quickstart.html

 

Quickstart — Spyder 5 documentation

 

docs.spyder-ide.org

 

반응형
반응형

파이썬 식별자(Identifiers)

파이썬 식별자는 변수, 함수, 클래스, 모듈 또는 다른 객체를 식별하는데 사용되는 이름을 뜻합니다. 
식별자는 문자 A부터 Z 또는 a에서 z 또는 밑줄 (_)로 시작하며 한 개 또는 그 이상의 문자로 구성됩니다. 
파이썬에서는 @, $, %와 같은 특수 문자를 식별자 내에서 사용할 수 없습니다. 
파이썬은 대소 문자를 구별하는 프로그래밍 언어이기 때문에 Manpower와 manpower는 Python에서 두 개의 다른 식별자로 처리됩니다. 

다음은 Python 식별자의 명명 규칙입니다.
 - 클래스 이름은 대문자로 시작합니다. 다른 모든 식별자는 소문자로 시작합니다.
 - 1개의 밑줄로 시작: 내부적으로 사용되는 변수입니다.
 - 1개의 밑줄로 종료: 파이썬 기본 키워드와 충돌을 피하려고 사용됩니다.
 - 2개의 밑줄로 시작: 클래스 속성으로 사용합니다.
 - 2개의 밑줄로 종료: 사용자가 조정할 수 있는 네임스페이스 안의 속성입니다.
 - 식별자는 숫자로 시작될 수 없다. 1variable은 오류이지만 variable1 은 괜찮다.
 - 키워드는 식별자로 사용할 수 없다.
 - !, @, #, $, % 등 특수 기호는 우리 식별자에서 사용할 수 없다.
 - 식별자의 길이는 제한이 없다.

python3에서는 유니코드 문자를 식별자로 사용할 수 있습니다. 즉, 한글로도 변수명을 지을 수 있지만 권장되지는 않는다고 합니다.

반응형
반응형

[python] calendar 모듈, 달력 사용하기  https://docs.python.org/ko/3/library/calendar.html

 

calendar — General calendar-related functions

Source code: Lib/calendar.py This module allows you to output calendars like the Unix cal program, and provides additional useful functions related to the calendar. By default, these calendars have...

docs.python.org

# https://docs.python.org/ko/3/library/calendar.html
import calendar

yy = 2023
mm = 5

#display the calendar
print(calendar.month(yy,mm))

#calendar 모듈 내용 확인
print(dir(calendar))

calendar 모듈을 좀 더 살펴보겠습니다.

문제 1. calendar 모듈을 임포트하는 문장을 완성하세요.

>>> ____ calendar

calendar 모듈에 무엇이 있는지 살펴보세요.

>>> dir(calendar)
['Calendar', 'EPOCH', 'FRIDAY', 'February', 'HTMLCalendar', 'IllegalMonthError', 'IllegalWeekdayError', 'January', 'LocaleHTMLCalendar', 'LocaleTextCalendar', 'MONDAY', 'SATURDAY', 'SUNDAY', 'THURSDAY', 'TUESDAY', 'TextCalendar', 'WEDNESDAY', '_EPOCH_ORD', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_colwidth', '_locale', '_localized_day', '_localized_month', '_monthlen', '_nextmonth', '_prevmonth', '_spacing', 'c', 'calendar', 'datetime', 'day_abbr', 'day_name', 'different_locale', 'error', 'firstweekday', 'format', 'formatstring', 'isleap', 'leapdays', 'main', 'mdays', 'month', 'month_abbr', 'month_name', 'monthcalendar', 'monthrange', 'prcal', 'prmonth', 'prweek', 'repeat', 'setfirstweekday', 'sys', 'timegm', 'week', 'weekday', 'weekheader']

이와 같이 모듈은 수많은 공구가 들어 있는 '공구통'이라고 생각할 수 있습니다.

문제 2. calendar 모듈에 leap이라는 문자열을 포함하는 이름은 어떤 것이 있는지 찾아보세요.1

>>> [x for x in dir(calendar) if 'leap' in x]
[____, ____]

문제 3. 주어진 해가 윤년인지 아닌지 판별하는 함수의 사용법을 확인해보세요.

>>> help(____)
Help on function ____ in module calendar:

____(year)
    Return True for leap years, False for non-leap years.

문제 4. 이 함수를 사용해서 2077년이 윤년인지 아닌지 확인해보세요.

>>> ____
False

https://github.com/ychoi-kr/wikidocs-chobo-python/blob/master/ch05/using_modules.ipynb

 

GitHub - ychoi-kr/wikidocs-chobo-python: 《왕초보를 위한 파이썬》 예제 코드

《왕초보를 위한 파이썬》 예제 코드. Contribute to ychoi-kr/wikidocs-chobo-python development by creating an account on GitHub.

github.com

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "attractive-marketing",
   "metadata": {},
   "outputs": [],
   "source": [
    "#문제 1\n",
    "import calendar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "greatest-event",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Calendar',\n",
       " 'EPOCH',\n",
       " 'FRIDAY',\n",
       " 'February',\n",
       " 'HTMLCalendar',\n",
       " 'IllegalMonthError',\n",
       " 'IllegalWeekdayError',\n",
       " 'January',\n",
       " 'LocaleHTMLCalendar',\n",
       " 'LocaleTextCalendar',\n",
       " 'MONDAY',\n",
       " 'SATURDAY',\n",
       " 'SUNDAY',\n",
       " 'THURSDAY',\n",
       " 'TUESDAY',\n",
       " 'TextCalendar',\n",
       " 'WEDNESDAY',\n",
       " '_EPOCH_ORD',\n",
       " '__all__',\n",
       " '__builtins__',\n",
       " '__cached__',\n",
       " '__doc__',\n",
       " '__file__',\n",
       " '__loader__',\n",
       " '__name__',\n",
       " '__package__',\n",
       " '__spec__',\n",
       " '_colwidth',\n",
       " '_locale',\n",
       " '_localized_day',\n",
       " '_localized_month',\n",
       " '_monthlen',\n",
       " '_nextmonth',\n",
       " '_prevmonth',\n",
       " '_spacing',\n",
       " 'c',\n",
       " 'calendar',\n",
       " 'datetime',\n",
       " 'day_abbr',\n",
       " 'day_name',\n",
       " 'different_locale',\n",
       " 'error',\n",
       " 'firstweekday',\n",
       " 'format',\n",
       " 'formatstring',\n",
       " 'isleap',\n",
       " 'leapdays',\n",
       " 'main',\n",
       " 'mdays',\n",
       " 'month',\n",
       " 'month_abbr',\n",
       " 'month_name',\n",
       " 'monthcalendar',\n",
       " 'monthrange',\n",
       " 'prcal',\n",
       " 'prmonth',\n",
       " 'prweek',\n",
       " 'repeat',\n",
       " 'setfirstweekday',\n",
       " 'sys',\n",
       " 'timegm',\n",
       " 'week',\n",
       " 'weekday',\n",
       " 'weekheader']"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(calendar)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "silver-delhi",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['isleap', 'leapdays']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#문제 2\n",
    "[x for x in dir(calendar) if 'leap' in x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ultimate-collaboration",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function isleap in module calendar:\n",
      "\n",
      "isleap(year)\n",
      "    Return True for leap years, False for non-leap years.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#문제 3\n",
    "help(calendar.isleap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ancient-newport",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#문제 4\n",
    "calendar.isleap(2077)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "arbitrary-eleven",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
반응형

+ Recent posts