python tag

Python is a high-level, interpreted, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.

Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming. It is often described as a "batteries included" language due to its comprehensive standard library.

Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and first released it in 1991 as Python 0.9.0. Python 2.0 was released in 2000 and introduced new features such as list comprehensions, cycle-detecting garbage collection, reference counting, and Unicode support. Python 3.0, released in 2008, was a major revision that is not completely backward-compatible with earlier versions. Python 2 was discontinued with version 2.7.18 in 2020.

Python consistently ranks as one of the most popular programming languages. It is used by many organizations and companies. Pixar, Disney, Instagram and the developers of the Linux Kernel are among many of it's high-profile users, which includes many developers of Free and Open source software.

Reference: WIKIPEDIA

208 questions


1 answers
174 views
0
Pandas에서 열을 한 열로 모으고 다른 열로 정렬할 수 있는 방법이 있을까요?

DataFrame에는 title과 val이라는 두 개의 열이 있습니다. >>> df=pd.DataFrame( ... { ... "title": ["a", "a", "a", "b", "b", "b",...

1 years ago

1 answers
168 views
0
파이썬으로 텍스트 파일에 행렬 쓰기

다음 코드를 사용하여 텍스트 파일에 쓸 때 다음 출력이 표시됩니다. import numpy as np a = np.random.randint(1, 1000, size =(100, 30),dtype='int64') print(a) np.savetxt('filename.txt', a) Output 5.10000000000000000...

1 years ago

1 answers
160 views
0
pandas dataframe에서 이동된 인덱스 값을 기준으로 새 열을 만드는 방법

필터링된 pandas dataframe을 받았는데 이동된 인덱스 값을 기준으로 새 열을 만들고 싶습니다. Point 124 12 559 1 717 12 결과 ...

1 years ago

1 answers
154 views
0
파이썬에서 모든 구성 요소를 더한 다음 다음으로 이동하기

다음과 같은 숫자 리스트가 있습니다. numbers = [ 2892921, 1939929, 2929202, 1758690 ] 다음과 같은 방법으로 번호를 서로에게 더해야 합니다. 1 + 2 + 3 + ... + 2892921 = 더하기 for loop는 다음으로 진행 1 + 2 + 3 + ... + 19...

1 years ago

2 answers
250 views
0
플래그 열에 모든 1이 있을 때 dataframe에서 그룹을 가져오고 크기가 2보다 큰 그룹을 유지하는 방법

플래그가 1인 그룹을 추출하고 크기가 2보다 크면 그룹을 유지했으면 합니다. df2=pd.DataFrame({'A':[1,20,40,45,56,1,20,40,45,56],'flag':[3,2,4,1,1,3,3,1,1,1]}) print(df2) A flag 0 1 3 1 20 2 2 40 4 3 45 1 4 56 1 ...

1 years ago

1 answers
135 views
0
"if"의 어떤 조건(또는 "if"를 사용하여)이 if 내부에 입력되었기 때문에 참이라고 하는지 확인할 수 있는 방법이 있습니까?

간단하게 아래와 같은 코드가 있다고 한다면 if cond1 or cond2 or cond3: do_something() 이 세 가지 조건(cond1, cond2, cond3) 중 어떤 조건이 참인지 알 수 있을까요? 저는 어떤 것이 사실인지 알아내기 위해 제 아래에 있는 다른 2개의 if를 사용하라고 제안하지 않는 답을 찾고 있습니다.

1 years ago

1 answers
156 views
0
파이썬에서 string, datetime으로 정렬하기

아래처럼 2개의 속성이 있는데요. i.member : str i.time : datetime 아래처럼 sorting을 해보려 했는데요. l.sort(key=lambda i: (i.member, -i.time)) 그러나 datetime에서는 -가 안된다네요. pandas를 쓰면 되긴 합니다만 최대한 로드를 줄이기 위해 일반 파이썬으로 해보고 싶어서요. 혹시...

1 years ago

3 answers
153 views
0
파이썬에서 파일 다운로드 하는 방법

파이썬은 처음이라 잘 몰라서요. 서버에 요청해서 파일을 다운받고 싶은데요. 브라우저에 CSV 파일을 입력하면 CSV 파일이 다운로드 할 수 있는데요. 아래와 같은 코드로 파이썬으로 get 요청을 보내봐도 아무 것도 리턴하지 않습니다. import urllib2 response = urllib2.urlopen('https://publicwww.com/...

1 years ago

2 answers
149 views
0
파이썬에서 pynput.mouse을 쓸 때 작업을 n번 수행하도록 하려면 어떻게 해야 하나요?

파이썬에서 아래와 같은 작업을 하려는데요. from pynput.mouse import Button, Controller mouse = Controller() mouse.position(660,226) mouse.press(Button.left) mouse.release(Button.left) 10초마다 n번을 수행하려면 어떻게 하면 되나요?

1 years ago

1 answers
387 views
0
파이썬에서 The driver cannot recognize the specified command parameter 에러 해결방법

아래 코드처럼 playsound를 이용하려는데요. from playsound import playsound playsound("1.mp3") 그러면 아래와 같이 에러가 납니다. Error 259 for command: play 1.mp3 wait The driver cannot recognize the specified command...

1 years ago
- 1 - »

© 2023 OneMinuteCode. All rights reserved.