전체 글 (245)
2025-08-04 23:45:34
반응형

🌐 대화형 AI 서비스 비교

항목  ChatGPT  Claude  Gemini
개발사 OpenAI Anthropic Google (DeepMind)
모델 (2025 기준) GPT-4o Sonnet 4 (무료), Opus 4 (유료) Gemini 2.5 Flash
무료 사용 GPT-3.5 Sonnet 4 Gemini 2.5 Flash / Flash Lite
유료 플랜 ChatGPT Plus ($20/월, GPT-4o) Claude Pro ($20/월, Opus 4) Google One AI Premium ($20/월)
코딩 능력 ★★★★★ (코드 해석·플러그인 풍부) ★★★★☆ (코드 설명 강점) ★★★★☆ (구조적 이해도 높음)
최신 정보 반영 ★★★★☆ ★☆☆☆☆ ★★★★★
생태계 연동 ★★★☆☆ ★☆☆☆☆ ★★★★★
요약 균형 잡힌 만능형 문서 요약·분석 최적 후발주자지만 Not Bad
 
 

📑 검색/문서 특화 AI 비교


항목  NotebookLM  Perplexity  Grok
개발사 Google Perplexity Labs xAI
모델 (2025 기준) NotebookLM 기본 버전 Standard Grok 4
주요 기능 문서 요약, 오디오/비디오 요약, Mind-map, Report 실시간 검색 기반 AI, 출처 제공 고급 추론, 코드 특화 (Grok 4 Code), 텍스트→비디오 예정
출처 표시 제한적 항상 출처 포함 없음 (내부 추론 중심)
무료 사용 100노트북, 오디오 3회 제한 Pro 검색 하루 5회 제한적 무료 사용 가능
유료 플랜 NotebookLM Plus ($20/월) Pro $20/월, Enterprise Pro $40/seat Premium+ $40, SuperGrok $30, Heavy $300
 
 

🎨 콘텐츠/시각화 AI 비교

항목  Napkin  Gamma
개발사 Napkin AI Gamma Labs
모델 (2025 기준) NotebookLM 기반 Standard
주요 기능 텍스트 설명 → 다이어그램/인포그래픽 자동 생성 카드 기반 프레젠테이션·웹페이지·소셜 콘텐츠 생성
사용 목적 텍스트 → 시각화 AI 자동 슬라이드/웹페이지 제작
장점 간단한 설명으로 빠른 시각화 전문가 수준의 콘텐츠 생성
단점 무료 플랜은 워터마크·크레딧 제한 무료 플랜은 카드 수·기능 제한
무료 사용 주 500 credits 가입 시 400 credits
반응형
2022-06-28 22:19:11
반응형

Commit 날짜 변경하는 방법 정리

 

개발자라면 1일 1커밋 운동을 목표로 열심히 잔디를 심는 경우가 많다.

나처럼 게으른 개발자 취준생은 이따가 해야지 5분만 잤다가 일어나서 해야지 하다가 다음날 새벽에 일어나는 경우

커밋을 못해 비어있는 칸에 잔디심는 방법을 정리해서 간간히 써먹어 보려고 한다.

 

Commit 날짜 변경 방법

 

1. Github Login 후 우측 상단에서 + 모양 클릭 → New repository 마우스로 클릭

2. Repository Name 입력 → Public 선택 → Create repository 마우스로 클릭

 

3. 커밋할 폴더를 선택하여 마우스 우클릭 → Git Bash Here 마우스로 클릭

4. 초반 세팅 명령어

git init   # 새로운 repository를 만들고 Git으로 프로젝트 관리를 시작할 때는 다음 명령어을 입력
git status # Git으로 작업을 할 때 어떤 파일이 변경되었는지, 추가되었는지 등 전부 확인 가능
git add .  # 폴더 내에 있는 파일 전체 add

# 다른 방법

git init
vi test3.txt
git status
git add .  # 폴더 내에 있는 파일 전체 add
git add test3.txt

 

5. Commit 명령어 실행

git commit -m "Commit Message" # 명령어
git commit -m "first commit"   # 실제 사용한 명령어

 

6. Repository에 Code Push

git remote add origin [repository 주소]
git remote -v
git push -u orign master

### 실제 사용한 명령어
git remote add origin https://github.com/DevYJShin/git_test 
git remote -v
git push -u origin master

7. Commit 여부는 Github Repository Page에서 확인 가능

# git push 명령어를 실행하면 GitHub 유저네임과 비밀번호를 입력
# 성공적으로 push 되었다면 GitHub repository 페이지에서 확인 가능

8. 이제 비어있는 칸에 잔디를 심어보자.

9. Commit 날짜 수정 명령어

Commit 날짜 수정 방법은 과거 Commit과 현재 Commit 2가지가 있는데, 

과거 Commit의 경우 복잡해서 저같은 초보가 건들기에는 어려우니 현재 Commit으로 날짜 수정하는 방법을 정리해보고자 한다.

git commit --amend --no-edit --date "$(date)"
git commit --amend --no-edit --date "Fri 14 Jan 2022 20:00:00 KST"
git rebase --continue      # 굳이 안해도 되나?
git push -f origin master

10. Commit 날짜 변경 후 반영 여부 확인

 

1일 1커밋 미루지 말자 다들 화이팅!

 

 출처

 

* Github Commit 방법

https://velog.io/@kho5420/Git-GitHub-%EB%A0%88%ED%8C%8C%EC%A7%80%ED%86%A0%EB%A6%ACRepository-%EC%83%9D%EC%84%B1%ED%95%98%EA%B3%A0-%EC%86%8C%EC%8A%A4-%EC%98%AC%EB%A6%AC%EA%B8%B0

* Github Commit 날짜 수정 방법

https://scl2589.github.io/git/edit-commit-date/

 

커밋 날짜를 수정하는 방법

Commit 날짜 수정하는 방법을 알아보았습니다.

scl2589.github.io

 

 

반응형

'Github' 카테고리의 다른 글

[Github] Contribution Color Graph  (0) 2022.01.28
[Github] Activity Overview 설정  (0) 2022.01.28
[Github] Commit Graph 3D  (0) 2022.01.28
[Github] 잔디 먹는 뱀 만들기  (0) 2022.01.01
2022-04-22 09:52:36

보호글입니다.
비밀번호를 입력하시면
내용을 보실 수 있습니다.


2022-04-19 15:36:36
반응형

1차원 배열 추가 및 삭제

 

 

 1차원 배열 추가

 

'''
   1차원 배열 추가
   1) np.append(arr, 값, axis=0)
    ==> 값 추가해서 새로운 벡터 반환
    ==> axis=0이 기본이고 행축을 고정한다는 의미이다.
       따라서 열이 추가됨
   2) np.insert(arr, 위치(idx|fancy), 값, axis=0)

'''
import numpy as np
list_value= [10,20,30,40,50]
arr = np.array(list_value)
print(arr)

# 1) np.append(arr, 값, axis=0)
arr2 = np.append(arr, 100)
print(arr2) # [ 10  20  30  40  50 100]
print("원보:", arr) # [10 20 30 40 50]

arr2 = np.append(arr, [100,300])
print(arr2) # [ 10  20  30  40  50 100 300]

# 2) np.insert
list_value= [10,20,30,40,50]
arr = np.array(list_value)
arr2 = np.insert(arr,0, 100) # 색인: 인덱싱
print(arr2) # [100  10  20  30  40  50]
arr2 = np.insert(arr,[0,2], 100) # 색인: fancy 색인(정수형 색인)
print(arr2) # [100  10  20 100  30  40  50]

arr2 = np.insert(arr,[0,2,1], 100) # 색인: fancy 색인(정수형 색인)
print(arr2) # [100  10 100  20 100  30  40  50]

* 출력 화면

 1차원 배열 삭제

 

'''
   1차원 배열 삭제
   1) np.delete(arr, 위치(idx|fancy|np.s_[s:e]), axis )


'''
import numpy as np

list_value= [10,20,30,40,50]
arr = np.array(list_value)
print(arr)

arr2 = np.delete(arr, 0)  # 색인: 인덱싱
print(arr2) # [20 30 40 50]

arr2 = np.delete(arr, -1)  # 색인: 인덱싱
print(arr2) # [20 30 40 50]

arr2 = np.delete(arr, [0,2,3])  # 색인: fancy 색인(정수형 색인)
print(arr2) # [20 50]

arr2 = np.delete(arr, [0,2,-1])  # 색인: fancy 색인(정수형 색인)
print(arr2) # [20 40]

# 슬라이싱 삭제
list_value= [10,20,30,40,50]
arr = np.array(list_value)

arr2 = np.delete(arr, np.s_[1:4])  # 색인: 슬라이싱 ==>  np.s_[s:e]
print(arr2) # [20 30 40 50]

* 출력 화면

 

 출처

 

 

+ 강의 교재

반응형

'AI Bootcamp > Numpy' 카테고리의 다른 글

[Numpy] 1일차_1차원 배열 생성  (0) 2022.04.19
[Numpy] 1일차_0차열 배열  (0) 2022.04.19
2022-04-19 15:33:53
반응형

1차원 배열 생성

 

 

 1차원 배열 생성_Vector1_array 함수

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)

'''
import numpy as np

# 1. 벡터 생성
list_value= [10,20,30]
vector_value = np.array(list_value)

print("list_value:", list_value, type(list_value)) # [10, 20, 30] <class 'list'>
print("vector_value:", vector_value, type(vector_value)) # [10 20 30] <class 'numpy.ndarray'>

* 출력 화면

 

 1차원 배열 생성_Vector2_array 함수2_list와 vector 차이점

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)

'''
import numpy as np

# 1. 벡터 생성
list_value= [10,20,30]
vector_value = np.array(list_value)

print("list_value:", list_value, type(list_value)) # [10, 20, 30] <class 'list'>
print("vector_value:", vector_value, type(vector_value)) # [10 20 30] <class 'numpy.ndarray'>

# 2. 파이썬의 리스트 vs 벡터
# 가. 벡터는 자동으로 형변환이 된다. ==> 반드시 동일한 타입만 저장 가능하다.
list_value= [10,20,30,"A"]
list_value= [10,20,30,4.]
print(list_value)
vector_value = np.array(list_value)
print(vector_value)

# 나. 벡터화 연산: 벡터와 스칼라 연산
list_value= [10,20,30]
result = list_value * 2 # [10, 20, 30, 10, 20, 30]
print("파이썬의 결과:", result)
vector_value = np.array(list_value)
result = vector_value * 2 # [10 20 30] * 2 = [20 40 60] , 벡터화 연산(요소간 연산, 매우중요한 특징)
print("벡터 결과:", result)

# 다. 벡터화 연산: 벡터와 벡터 연산
list_value= [90,80,70]
list_value2= [10,20,30]
result = list_value + list_value2 # [90, 80, 70, 10, 20, 30]
print(result)

vector_value = np.array(list_value)
vector_value2 = np.array(list_value2)
result = vector_value + vector_value2 # [100 100 100],요소간 연산
print(result)

# 라. 얕은 복사(주소값복사) 와 깊은 복사(실제값복사)
list_value= [90,80,70]
s = list_value[:]  # 파이썬의 슬라이싱은 깊은복사,   list(), .copy()
list_value[0]=900
print(list_value)
print(s)

list_value= [10,20,30]
vector_value = np.array(list_value)
s = vector_value[:] # 벡터의 슬라이싱은 얕은복사 ==> 성능 때문에
vector_value[0]=100
print(vector_value)
print(s)

# 벡터의 깊은복사(실제값복사) 방법
list_value= [10,20,30]
vector_value = np.array(list_value)
# new_vector_value = vector_value.copy()
new_vector_value = np.copy(vector_value)
vector_value[0]= 100

print(vector_value) # [100  20  30]
print(new_vector_value) # [10 20 30] , 깊은복사이기 때문에 수정 안됨.

* 출력 화면

 

 1차원 배열 생성_Vector3_array 함수3_속성

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)
   나. 속성
     print(dir(변수))


'''
import numpy as np

# 1. 벡터 생성
list_value= [10,20,30]
vector_value = np.array(list_value)
print("vector_value:", vector_value, type(vector_value)) # [10 20 30] <class 'numpy.ndarray'>

print("벡터의 차원크기:", vector_value.ndim) # 1
print("벡터의 형상(모양):", vector_value.shape) # (3,)  # 매우 중요하다.
print("벡터의 요소갯수:", vector_value.size) # 3
print("벡터의 요소타입:", vector_value.dtype) # int32

# print(dir(np))
# print(dir(vector_value))
'''
['T', '__abs__', '__add__', '__and__', '__array__', '__array_finalize__', '__array_function__', 
'__array_interface__', '__array_prepare__', '__array_priority__', '__array_struct__', 
'__array_ufunc__', '__array_wrap__', '__bool__', '__class__', '__class_getitem__', 
'__complex__', '__contains__', '__copy__', '__deepcopy__', '__delattr__', '__delitem__', 
'__dir__', '__divmod__', '__dlpack__', '__dlpack_device__', '__doc__', '__eq__', '__float__', 
'__floordiv__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', 
'__iadd__', '__iand__', '__ifloordiv__', '__ilshift__', '__imatmul__', '__imod__', '__imul__', '__index__', 
'__init__', '__init_subclass__', '__int__', '__invert__', '__ior__', '__ipow__', '__irshift__', '__isub__', '__iter__', 
'__itruediv__', '__ixor__', '__le__', '__len__', '__lshift__', '__lt__', '__matmul__', '__mod__', '__mul__', '__ne__', 
'__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', 
'__repr__', '__rfloordiv__', '__rlshift__', '__rmatmul__', '__rmod__', '__rmul__', '__ror__', '__rpow__', '__rrshift__', 
'__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__setitem__', '__setstate__', '__sizeof__', '__str__', 
'__sub__', '__subclasshook__', '__truediv__', '__xor__', 


'all', 'any', 'argmax', 'argmin', 'argpartition', 'argsort', 'astype', 'base', 'byteswap', 
'choose', 'clip', 'compress', 'conj', 'conjugate', 'copy', 'ctypes', 'cumprod', 'cumsum', 'data', 
'diagonal', 'dot', 'dtype', 'dump', 'dumps', 'fill', 'flags', 'flat', 'flatten', 'getfield', 'imag', 
'item', 'itemset', 'itemsize', 'max', 'mean', 'min', 'nbytes', 'ndim', 'newbyteorder', 'nonzero', 'partition', 
'prod', 'ptp', 'put', 'ravel', 'real', 'repeat', 'reshape', 'resize', 'round', 'searchsorted', 'setfield', 
'setflags', 'shape', 'size', 'sort', 'squeeze', 'std', 'strides', 'sum', 'swapaxes', 'take', 'tobytes', 'tofile', 
'tolist', 'tostring', 'trace', 'transpose', 'var', 'view']
'''

* 출력 화면

 

 

 1차원 배열 생성_Vector4_랜덤 함수

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)
   나. 랜덤함수
      np.random.random() : [0.0  1.0) 범위값 반환
      np.random.random(size) : [0.0  1.0) 범위값에서 size만큼 반환
      np.random.rand()    : 0~1사이의 균등분포에서 반환, 뽑힐 확률 동일
      np.random.randn()    : 정규분포에서 반환, 평균이 0이고 표준편차 1 ==> N(0,1)
      np.random.randint(low, high=None) : high 미지정시 범위:  [0 low) ==> 0<= 값 <low
      np.random.randint(low, high) :   [low high) ==> low<= 값 <high


'''
import numpy as np
# 랜덤값 고정 ==> seed 고정
# np.random.seed(1234)

arr = np.random.random() # [0.0  1.0) ==> 범위   0.0 <=    <1.0
print("random() 함수:", arr, type(arr))  # <class 'float'>

arr = np.random.random(3) # [0.0  1.0) ==> 범위   0.0 <=    <1.0
print("random(size) 함수:", arr, type(arr)) # <class 'numpy.ndarray'>

arr = np.random.rand() # [0.0  1.0) ==> 범위   0.0 <=    <1.0
print("rand() 함수:", arr, type(arr)) # <class 'float'>

arr = np.random.rand(5) # [0.0  1.0) ==> 범위   0.0 <=    <1.0
print("rand(size) 함수:", arr, type(arr)) # <class 'numpy.ndarray'>

arr = np.random.randn() # [0.0  1.0) ==> 범위   0.0 <=    <1.0
print("randn() 함수:", arr, type(arr)) # <class 'float'>

arr = np.random.randn(7) # [0.0  1.0) ==> 범위   0.0 <=    <1.0
print("randn(size) 함수:", arr, type(arr)) # <class 'numpy.ndarray'>

arr = np.random.randint(5) # 0 ~ 4까지의 랜덤값 반환
print("randint(low) 함수:", arr, type(arr)) # <class 'int'>

arr = np.random.randint(1,3) # 1<=  < 3까지의 랜덤값 반환
print("randint(low, high) 함수:", arr, type(arr)) # <class 'int'>

arr = np.random.choice(["A","B","C"])
print("choice()", arr)

list_value=[5,2,56,67]
np.random.shuffle(list_value)
print(list_value)


# print(dir(np.random))
'''
['BitGenerator', 'Generator', 'MT19937', 'PCG64', 'PCG64DXSM', 'Philox', 
'RandomState', 'SFC64', 'SeedSequence', '__RandomState_ctor', '__all__', '__builtins__', 
'__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', 
'__spec__', '_bounded_integers', '_common', '_generator', '_mt19937', '_pcg64', 
'_philox', '_pickle', '_sfc64', 

'beta', 'binomial', 'bit_generator', 'bytes', 'chisquare', 'choice', 
'default_rng', 'dirichlet', 'exponential', 'f', 'gamma', 'geometric', 
'get_state', 'gumbel', 'hypergeometric', 'laplace', 'logistic', 'lognormal', 
'logseries', 'mtrand', 'multinomial', 'multivariate_normal', 'negative_binomial', 
'noncentral_chisquare', 'noncentral_f', 'normal', 'pareto', 'permutation', 
'poisson', 'power', 'rand', 'randint', 'randn', 'random', 'random_integers', 
'random_sample', 'ranf', 'rayleigh', 'sample', 'seed', 
'set_state', 'shuffle', 'standard_cauchy', 'standard_exponential', 
'standard_gamma', 'standard_normal', 'standard_t', 'test', 'triangular', 
'uniform', 'vonmises', 'wald', 'weibull', 'zipf']
'''

* 출력 화면

 

 1차원 배열 생성_Vector5_zeros_ones

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)
   나. 랜덤함수
      np.random.random() : [0.0  1.0) 범위값 반환
      np.random.random(size) : [0.0  1.0) 범위값에서 size만큼 반환
      np.random.rand()    : 0~1사이의 균등분포에서 반환, 뽑힐 확률 동일
      np.random.randn()    : 정규분포에서 반환, 평균이 0이고 표준편차 1 ==> N(0,1)
      np.random.randint(low, high=None) : high 미지정시 범위:  [0 low) ==> 0<= 값 <low
      np.random.randint(low, high) :   [low high) ==> low<= 값 <high

   다. np.zeros(size, dtype=타입)
      ==> 모든 요소를  0.0 으로 채운 벡터 반환

   라. np.ones(size, dtype=타입)
      ==> 모든 요소를  1.0 으로 채운 벡터 반환
   마. np.empty(size, dtype=타입)
      ==> 임의의 값으로 초기화 됨, 값이 작으면 대부분이 1로 설정됨.
          임의의 값 초기화 확인 위해서는 size 늘려서 실습한다.

   마. np.full(size, 값, , dtype=타입)
      ==> 지정된 값으로 초기화 됨
'''
import numpy as np

arr = np.zeros(5)
print("zeros(size):" , arr) # [0. 0. 0. 0. 0.]
arr = np.zeros(5, dtype=int) # dtype=np.int32
print("zeros(size, dtype=int):" , arr) # [0 0 0 0 0]

arr = np.ones(5)
print("ones(size):" , arr) # [1. 1. 1. 1. 1.]
arr = np.ones(5, dtype=int) # dtype=np.int32
print("ones(size, dtype=int):" , arr) # [1 1 1 1 1]

arr = np.empty(5)
print("empty(size):" , arr) #
arr = np.empty(5, dtype=int) # dtype=np.int32
print("empty(size, dtype=int):" , arr)

arr = np.full(4, 100, dtype=int) # dtype=np.int32
print("full(size, 값, , dtype=타입):" , arr) # [100 100 100 100]

* 출력 화면

 1차원 배열 생성_Vector6_arange 함수

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)
   나. 랜덤함수
      np.random.random() : [0.0  1.0) 범위값 반환
      np.random.random(size) : [0.0  1.0) 범위값에서 size만큼 반환
      np.random.rand()    : 0~1사이의 균등분포에서 반환, 뽑힐 확률 동일
      np.random.randn()    : 정규분포에서 반환, 평균이 0이고 표준편차 1 ==> N(0,1)
      np.random.randint(low, high=None) : high 미지정시 범위:  [0 low) ==> 0<= 값 <low
      np.random.randint(low, high) :   [low high) ==> low<= 값 <high

   다. np.zeros(size, dtype=타입)
      ==> 모든 요소를  0.0 으로 채운 벡터 반환

   라. np.ones(size, dtype=타입)
      ==> 모든 요소를  1.0 으로 채운 벡터 반환
   마. np.empty(size, dtype=타입)
      ==> 임의의 값으로 초기화 됨, 값이 작으면 대부분이 1로 설정됨.
          임의의 값 초기화 확인 위해서는 size 늘려서 실습한다.

   마. np.full(size, 값, , dtype=타입)
      ==> 지정된 값으로 초기화 됨

   바. np.arange([start],stop[,step], dtype=타입)
    ==> 파이썬의 range()함수 유사하다.
'''
import numpy as np

arr = np.arange(5) # np.arange(stop) ==> [0 5)범위의 벡터 반환
print("arange(stop):", arr) # [0 1 2 3 4]

arr = np.arange(1,5) # np.arange(start, stop) ==> [1 5)범위의 벡터 반환
print("arange(start, stop):", arr) # [1 2 3 4]

arr = np.arange(1,10,2) # np.arange(start, stop, step) ==> [1 10)범위의 2step 벡터 반환
print("arange(start, stop, step):", arr) # [1 3 5 7 9]

# 실수값 반환
arr = np.arange(5, dtype=np.float32) # np.arange(stop, dtype=타입) ==> [0 5)범위의 벡터 반환
print("arange(stop):", arr) # [0. 1. 2. 3. 4.]

arr = np.arange(5.)
print("arange(stop):", arr) # [0. 1. 2. 3. 4.]

* 출력 화면

 1차원 배열 생성_Vector7_linspace 함수

 

'''
   배열생성
   1차원 배열:  벡터(vector)
   가. np.array(리스트)
   나. 랜덤함수
      np.random.random() : [0.0  1.0) 범위값 반환
      np.random.random(size) : [0.0  1.0) 범위값에서 size만큼 반환
      np.random.rand()    : 0~1사이의 균등분포에서 반환, 뽑힐 확률 동일
      np.random.randn()    : 정규분포에서 반환, 평균이 0이고 표준편차 1 ==> N(0,1)
      np.random.randint(low, high=None) : high 미지정시 범위:  [0 low) ==> 0<= 값 <low
      np.random.randint(low, high) :   [low high) ==> low<= 값 <high

   다. np.zeros(size, dtype=타입)
      ==> 모든 요소를  0.0 으로 채운 벡터 반환

   라. np.ones(size, dtype=타입)
      ==> 모든 요소를  1.0 으로 채운 벡터 반환
   마. np.empty(size, dtype=타입)
      ==> 임의의 값으로 초기화 됨, 값이 작으면 대부분이 1로 설정됨.
          임의의 값 초기화 확인 위해서는 size 늘려서 실습한다.

   마. np.full(size, 값, , dtype=타입)
      ==> 지정된 값으로 초기화 됨

   바. np.arange([start],stop[,step], dtype=타입)
    ==> 파이썬의 range()함수 유사하다.

   사.  np.linspace(start, stop, size)
    ==> 시각화할때 많이 사용됨.
'''
import numpy as np

arr = np.linspace(1,10,10)
print("np.linspace(1,10,10):", arr) # [ 1.  2.  3.  4.  5.  6.  7.  8.  9. 10.]

arr = np.linspace(1,10,10,endpoint=False)
print("np.linspace(1,10,10):", arr) # [1.  1.9 2.8 3.7 4.6 5.5 6.4 7.3 8.2 9.1]

arr = np.linspace(0,1,11)
print("np.linspace(0,1,11):", arr) # [0.  0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. ]

* 출력 화면

 출처

 

 

+ 강의 교재

반응형

'AI Bootcamp > Numpy' 카테고리의 다른 글

[Numpy] 1일차_1차열 배열 추가 및 삭제  (0) 2022.04.19
[Numpy] 1일차_0차열 배열  (0) 2022.04.19
2022-04-19 15:18:11
반응형

0차원 배열 

 

 

 스칼라 array 함수

 

'''
   배열생성
   0차원 배열:  스칼라
'''
import numpy as np
print("numpy 버전:", np.__version__) # numpy 버전: 1.22.3

# 1. 스칼라 생성
s = np.array(10)

print("값:", s) # 10
print("타입:", type(s)) # <class 'numpy.ndarray'>
print("차원:", s.ndim) # 0
print("형상(모양):", s.shape) # ()

print(dir(np))
'''
['ALLOW_THREADS', 'AxisError', 'BUFSIZE', 'CLIP', 'ComplexWarning', 'DataSource', 
'ERR_CALL', 'ERR_DEFAULT', 'ERR_IGNORE', 'ERR_LOG', 'ERR_PRINT', 'ERR_RAISE', 
'ERR_WARN', 'FLOATING_POINT_SUPPORT', 'FPE_DIVIDEBYZERO', 'FPE_INVALID', 'FPE_OVERFLOW', 
'FPE_UNDERFLOW', 'False_', 'Inf', 'Infinity', 'MAXDIMS', 'MAY_SHARE_BOUNDS', 'MAY_SHARE_EXACT', 
'ModuleDeprecationWarning', 'NAN', 'NINF', 'NZERO', 'NaN', 'PINF', 'PZERO', 'RAISE', 'RankWarning', 
'SHIFT_DIVIDEBYZERO', 'SHIFT_INVALID', 'SHIFT_OVERFLOW', 'SHIFT_UNDERFLOW', 'ScalarType', 
'Tester', 'TooHardError', 'True_', 'UFUNC_BUFSIZE_DEFAULT', 'UFUNC_PYVALS_NAME', 
'VisibleDeprecationWarning', 'WRAP', '_CopyMode', '_NoValue', '_UFUNC_API', '__NUMPY_SETUP__', 
'__all__', '__builtins__', '__cached__', '__config__', '__deprecated_attrs__', '__dir__', 
'__doc__', '__expired_functions__', '__file__', '__getattr__', '__git_version__', '__loader__', 
'__name__', '__package__', '__path__', '__spec__', '__version__', '_add_newdoc_ufunc', 
'_distributor_init', '_financial_names', '_from_dlpack', '_globals', '_mat', '_pytesttester', 
'_version', 

'abs', 'absolute', 'add', 'add_docstring', 'add_newdoc', 'add_newdoc_ufunc', 
'alen', 'all', 'allclose', 'alltrue', 'amax', 'amin', 'angle', 'any', 'append', 
'apply_along_axis', 'apply_over_axes', 'arange', 'arccos', 'arccosh', 'arcsin', 
'arcsinh', 'arctan', 'arctan2', 'arctanh', 'argmax', 'argmin', 'argpartition', 
'argsort', 'argwhere', 'around', 'array', 'array2string', 'array_equal', 'array_equiv', 
'array_repr', 'array_split', 'array_str', 'asanyarray', 'asarray', 'asarray_chkfinite', 
'ascontiguousarray', 'asfarray', 'asfortranarray', 'asmatrix', 'asscalar', 'atleast_1d', 
'atleast_2d', 'atleast_3d', 'average', 'bartlett', 'base_repr', 'binary_repr', 'bincount', 
'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blackman', 'block', 'bmat', 
'bool8', 'bool_', 'broadcast', 'broadcast_arrays', 'broadcast_shapes', 'broadcast_to', 
'busday_count', 'busday_offset', 'busdaycalendar', 'byte', 'byte_bounds', 'bytes0', 
'bytes_', 'c_', 'can_cast', 'cast', 'cbrt', 'cdouble', 'ceil', 'cfloat', 'char', 
'character', 'chararray', 'choose', 'clip', 'clongdouble', 'clongfloat', 'column_stack', 
'common_type', 'compare_chararrays', 'compat', 'complex128', 'complex64', 'complex_', 
'complexfloating', 'compress', 'concatenate', 'conj', 'conjugate', 'convolve', 'copy', 
'copysign', 'copyto', 'core', 'corrcoef', 'correlate', 'cos', 'cosh', 'count_nonzero', 
'cov', 'cross', 'csingle', 'ctypeslib', 'cumprod', 'cumproduct', 'cumsum', 'datetime64', 
'datetime_as_string', 'datetime_data', 'deg2rad', 'degrees', 'delete', 'deprecate', 
'deprecate_with_doc', 'diag', 'diag_indices', 'diag_indices_from', 'diagflat', 'diagonal', 
'diff', 'digitize', 'disp', 'divide', 'divmod', 'dot', 'double', 'dsplit', 'dstack', 'dtype', 
'e', 'ediff1d', 'einsum', 'einsum_path', 'emath', 'empty', 'empty_like', 'equal', 'errstate', 
'euler_gamma', 'exp', 'exp2', 'expand_dims', 'expm1', 'extract', 'eye', 'fabs', 'fastCopyAndTranspose', 
'fft', 'fill_diagonal', 'find_common_type', 'finfo', 'fix', 'flatiter', 'flatnonzero', 'flexible', 
'flip', 'fliplr', 'flipud', 'float16', 'float32', 'float64', 'float_', 'float_power', 'floating', 
'floor', 'floor_divide', 'fmax', 'fmin', 'fmod', 'format_float_positional', 'format_float_scientific', 
'format_parser', 'frexp', 'frombuffer', 'fromfile', 'fromfunction', 'fromiter', 'frompyfunc', 
'fromregex', 'fromstring', 'full', 'full_like', 'gcd', 'generic', 'genfromtxt', 'geomspace', 
'get_array_wrap', 'get_include', 'get_printoptions', 'getbufsize', 'geterr', 'geterrcall', 
'geterrobj', 'gradient', 'greater', 'greater_equal', 'half', 'hamming', 'hanning', 'heaviside', 
'histogram', 'histogram2d', 'histogram_bin_edges', 'histogramdd', 'hsplit', 'hstack', 'hypot', 
'i0', 'identity', 'iinfo', 'imag', 'in1d', 'index_exp', 'indices', 'inexact', 'inf', 'info', 
'infty', 'inner', 'insert', 'int0', 'int16', 'int32', 'int64', 'int8', 'int_', 'intc', 'integer', 
'interp', 'intersect1d', 'intp', 'invert', 'is_busday', 'isclose', 'iscomplex', 'iscomplexobj', 
'isfinite', 'isfortran', 'isin', 'isinf', 'isnan', 'isnat', 'isneginf', 'isposinf', 'isreal', 
'isrealobj', 'isscalar', 'issctype', 'issubclass_', 'issubdtype', 'issubsctype', 'iterable', 
'ix_', 'kaiser', 'kron', 'lcm', 'ldexp', 'left_shift', 'less', 'less_equal', 'lexsort', 'lib', 
'linalg', 'linspace', 'little_endian', 'load', 'loadtxt', 'log', 'log10', 'log1p', 'log2', 
'logaddexp', 'logaddexp2', 'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'logspace', 
'longcomplex', 'longdouble', 'longfloat', 'longlong', 'lookfor', 'ma', 'mask_indices', 'mat', 
'math', 'matmul', 'matrix', 'matrixlib', 'max', 'maximum', 'maximum_sctype', 'may_share_memory', 
'mean', 'median', 'memmap', 'meshgrid', 'mgrid', 'min', 'min_scalar_type', 'minimum', 'mintypecode', 
'mod', 'modf', 'moveaxis', 'msort', 'multiply', 'nan', 'nan_to_num', 'nanargmax', 'nanargmin', 
'nancumprod', 'nancumsum', 'nanmax', 'nanmean', 'nanmedian', 'nanmin', 'nanpercentile', 'nanprod', 
'nanquantile', 'nanstd', 'nansum', 'nanvar', 'nbytes', 'ndarray', 'ndenumerate', 'ndim', 'ndindex', 
'nditer', 'negative', 'nested_iters', 'newaxis', 'nextafter', 'nonzero', 'not_equal', 'numarray', 
'number', 'obj2sctype', 'object0', 'object_', 'ogrid', 'oldnumeric', 'ones', 'ones_like', 'os', 
'outer', 'packbits', 'pad', 'partition', 'percentile', 'pi', 'piecewise', 'place', 'poly', 
'poly1d', 'polyadd', 'polyder', 'polydiv', 'polyfit', 'polyint', 'polymul', 'polynomial', 'polysub', 
'polyval', 'positive', 'power', 'printoptions', 'prod', 'product', 'promote_types', 'ptp', 'put', 
'put_along_axis', 'putmask', 'quantile', 'r_', 'rad2deg', 'radians', 'random', 'ravel', 
'ravel_multi_index', 'real', 'real_if_close', 'rec', 'recarray', 'recfromcsv', 'recfromtxt', 
'reciprocal', 'record', 'remainder', 'repeat', 'require', 'reshape', 'resize', 'result_type', 
'right_shift', 'rint', 'roll', 'rollaxis', 'roots', 'rot90', 'round', 'round_', 'row_stack', 's_', 
'safe_eval', 'save', 'savetxt', 'savez', 'savez_compressed', 'sctype2char', 'sctypeDict', 'sctypes', 
'searchsorted', 'select', 'set_numeric_ops', 'set_printoptions', 'set_string_function', 'setbufsize', 
'setdiff1d', 'seterr', 'seterrcall', 'seterrobj', 'setxor1d', 'shape', 'shares_memory', 'short', 
'show_config', 'sign', 'signbit', 'signedinteger', 'sin', 'sinc', 'single', 'singlecomplex', 
'sinh', 'size', 'sometrue', 'sort', 'sort_complex', 'source', 'spacing', 'split', 'sqrt', 'square', 
'squeeze', 'stack', 'std', 'str0', 'str_', 'string_', 'subtract', 'sum', 'swapaxes', 'sys', 'take', 
'take_along_axis', 'tan', 'tanh', 'tensordot', 'test', 'testing', 'tile', 'timedelta64', 'trace', 
'tracemalloc_domain', 'transpose', 'trapz', 'tri', 'tril', 'tril_indices', 'tril_indices_from', 
'trim_zeros', 'triu', 'triu_indices', 'triu_indices_from', 'true_divide', 'trunc', 'typecodes', 
'typename', 'ubyte', 'ufunc', 'uint', 'uint0', 'uint16', 'uint32', 'uint64', 'uint8', 'uintc', 
'uintp', 'ulonglong', 'unicode_', 'union1d', 'unique', 'unpackbits', 'unravel_index', 'unsignedinteger', 
'unwrap', 'use_hugepage', 'ushort', 'vander', 'var', 'vdot', 'vectorize', 'version', 'void', 'void0', 
'vsplit', 'vstack', 'warnings', 'where', 'who', 'zeros', 'zeros_like']
'''

* 출력 화면

 

 출처

 

 

+ 강의 교재

반응형

'AI Bootcamp > Numpy' 카테고리의 다른 글

[Numpy] 1일차_1차열 배열 추가 및 삭제  (0) 2022.04.19
[Numpy] 1일차_1차원 배열 생성  (0) 2022.04.19