본문 바로가기

Python17

Python Training Day 13. Lambda functions Chapter 15. Lambda functions Instead of defining the function somewhere and calling it, we can use python's lambda functions, which are inline functions defined at the same place we use it. They don't need to have a name, so they also called anonymous functions. We define a lambda function using the keyword lambda. your_function_name = lambda inputs : output Exercise l = [2,4,7,3,14,19] for i in.. 2022. 12. 26.
Python Training Day 12. List Comprehensions Chapter 14. List Comprehensions List Comprehensions is a very powerful tool, which creates a new list based on another list, in a single, readable line. for loops vs. list comprehension # for loop word_lengths = [] for word in words: if word != "the": word_lengths.append(len(word)) # list comprehension word_lengths = [len(word) for word in words if word != "the"] time comparison 2030개의 단어를 가진 St.. 2022. 12. 25.
Python Training Day 10 & 11. Pandas Basics, Generators Chapter 13. Pandas Basics Pandas DataFrames It is built on the Numpy package and its key data structure is called the DataFrame. There are several ways to create a DataFrame. One way is to use a dictionary. Another way to create a DataFrame is by importing a csv file using Pandas. dict = {"country": ["Brazil", "Russia", "India", "China", "South Africa"], "capital": ["Brasilia", "Moscow", "New De.. 2022. 12. 23.
Python Training Day 9. Numpy Arrays Chapter 12. Numpy Arrays (learnpython) Numpy arrays are great alternatives to Python Lists. Fast, easy to work with, and give users the opportunity to perform calculations across entire arrays. # Create 2 new lists height and weight height = [1.87, 1.87, 1.82, 1.91, 1.90, 1.85] weight = [81.65, 97.52, 95.25, 92.98, 86.18, 88.45] import numpy as np # Create 2 numpy arrays from height and weight n.. 2022. 12. 20.
Coursera 구글 자격증(Google Data Analytics) Financial Aid로 무료로 공부하게 된 후기 목표를 명확히 하고 이루기 위한 방법을 찾기 위해 파고들어 실행하는 사람은, 결국 되게 만든다. 스페셜리스트+제너럴리스트 Business라는 게 내 사업이 아닌 이상, 남의 회사를 위해 일하는 구조에서는 잡다구리 한 업무의 비중이 크기에 전문성을 기르기 힘들 수 있다. 제너럴리스트도 가치가 있지만 진짜배기가 되려면 스페셜리스트+제너럴리스트가 될 수 있는 일을 해야 한다. 단순히 도메인 지식만 가지고는 스+제 인간이 되기 많이 부족하다. 소프트 스킬보다 더 막강한 건 테크니컬 스킬이다. 인공지능 전공을 이력에 넣고 인공지능 전문가에 더 가까워지기 위해 대학원 지원도 하고 온라인 대학도 지원해 공부를 더 깊게 하자는 계획을 하나씩 실천 중이다. 그 와중에도 좀 더 빨리 목표를 이룰 길은 없을까 매일 같이 고.. 2022. 12. 20.
Python Training Day 8. Modules and Packages Chapter 11. Modules and Packages (learnpython.org) Exercise 오늘은 다른 더 중요한 일이 있어서 Exercise 결과만 올려두고, 텍스트 정리는 내일 하려 한다. 2022. 12. 19.
Python Training Day 7. Dictionaries Chapter 10. Dictionaries (learnpython.org) 1. How to define a dictionary phonebook = {} phonebook["John"] = 938477566 phonebook["Jack"] = 938377264 phonebook["Jill"] = 947662781 phonebook = { "John" : 938477566, "Jack" : 938377264, "Jill" : 947662781 } 2. Iterating over dictionaries phonebook = {"John" : 938477566,"Jack" : 938377264,"Jill" : 947662781} for name, number in phonebook.items(): prin.. 2022. 12. 18.
Python Training Day 6. Classes and Objects Chapter 9. Classes and Objects (learnpython.org) Objects are an encapsulation of variables and functions into a single entity. Objects get their variables and functions from classes. class MyClass: variable = "blah" def function(self): print("This is a message inside the class.") myobjectx = MyClass() # -------Accessing Object Variables------- myobjectx.variable print(myobjectx.variable) class M.. 2022. 12. 17.
Python Training Day5. Functions Chapter 8. Functions Define functions 1. Functions in python are defined using the block keyword "def", followed with the function's name as the block's name. 2. Functions may also receive arguments (variables passed from the caller to the function). 3. Functions may return a value to the caller, using the keyword- 'return' . Call functions Simply write the function's name followed by (), placin.. 2022. 12. 16.
Python Training Day4. Loops 오늘은 프로그래밍의 기본이자 꽃 Loop 문제를 풀었다. 문제가 쉬워서 출근 길, 회사에서 화장실 가는 길 걸어다니며 다 했다. 퇴근 길에 포스팅까지 마무리! Chapter 7. Loops 1. The "for" loop 2. "while" loops 3. "break" and "continue" statements 4. Can we use "else" clause for loops? Exercise List 안의 숫자 237까지만 출력되게 하고, 그 뒤 숫자들은 출력하지 않는 조건의 문제였다. for, while, break, continue를 쓸 때 신경써야 할 것은 print를 어느 위치에서 찍느냐이다. 2022. 12. 15.