전체 글345 [Python] Pandas Course on Kaggle - 3 This is the solution of pandas course (Summary Functions and Maps) on Kaggle site. 1. median() Function median_points = reviews.points.median() # or median_points = reviews["points"].median() 2. unique() Function countries = reviews.country.unique() # or countries = reviews["country"].unique() 3. value_counts() Function reviews_per_country = reviews.country.value_counts() # or reviews_per_countr.. 2022. 1. 19. [Python] Pandas Course on Kaggle - 2 This is the solution of pandas course (Indexing, Selecting & Assigning) on Kaggle site. 1. Select the Column desc = reviews["description"] # or desc = reviews.description 2. Select the Column and Row first_description = reviews["description"][0] # or first_description = reviews.description[0] # or first_description = reviews.description.loc[0] # or first_description = reviews.description.iloc[0].. 2022. 1. 17. [Python] Pandas Course on Kaggle - 1 This is the solution of pandas course (Creating, Reading and Writing) on Kaggle site. Setup import pandas as pd 1. Create a DataFrame fruits = pd.DataFrame( {"Apples": [30], "Bananas": [21]} ) 2. Create a DataFrame with Index fruit_sales = pd.DataFrame( {"Apples": [35, 41], "Bananas": [21, 34]}, index=["2017 Sales", "2018 Sales"] ) 3. Create a Series ingredients = pd.Series( ["4 cups", "1 cup", .. 2022. 1. 15. [PowerShell] Get Elapsed Time using PowerShell Script $startTime = $(get-date) # Tasks that you want to measure $elapsedTime = $(get-date) - $startTime $totalTime = "{0:HH:mm:ss}" -f ([datetime]$elapsedTime.Ticks) Write-Host $totalTime 2021. 12. 21. [Python] finterstellar를 사용하여 Stochastic으로 주식 매매 시그널 만들기 2021.12.09 - [Python] - [Python] finterstellar를 사용하여 RSI로 주식 매매 시그널 만들기 먼저 finterstellar가 처음이라면 이전 글을 보고 와주세요. Stochastic Stochastic은 최근 N일간 주가 범위 중 현재 주가가 얼마나 높이 있는지를 나타내는 지표입니다. 트레이딩에 이용하기 쉽도록 이 값들로 이동평균값을 구합니다. 이것을 Slow K라고 합니다. Slow K를 이용하여 다시 이동평균값을 구하여 Slow D를 만듭니다. 기본 적으로 14일 간의 주가를 사용하여 stochastic을 구하며, 각각의 이동평균값을 구하기 위한 기간은 3을 사용합니다. 평균회귀 전략으로 사용할 경우, 보통 Slow K가 20보다 낮을 때 매수를 하여 80보다 높을.. 2021. 12. 14. [Python] finterstellar를 사용하여 Bollinger Band로 주식 매매 시그널 만들기 2021.12.09 - [Python] - [Python] finterstellar를 사용하여 RSI로 주식 매매 시그널 만들기 먼저 finterstellar가 처음이라면 이전 글을 보고 와주세요. Bollinger Band Bollinger Band는 이동평균에 변동성을 결합한 그래프 입니다. Z-Score: 표준 점수 X: 각 데이터 값 µ: 평균 값 σ: 표준편차 즉, X 값이 평균에서 표준편차의 몇 배만큼 떨어져 있는가를 나타내며, 표준편차가 곧 변동성이므로 주가가 변동성 대비 어느 정도 수준에 위치해 있는지를 나타내게 됩니다. 볼린저 밴드의 각각의 선은 다음과 같습니다. 밴드 상단선: N일 간의 이동평균 + k × 표준편차 밴드 중심선: N일 간의 이동평균 밴드 중심선: N일 간의 이동평균 - .. 2021. 12. 12. [Python] finterstellar를 사용하여 Envelope로 주식 매매 시그널 만들기 2021.12.09 - [Python] - [Python] finterstellar를 사용하여 RSI로 주식 매매 시그널 만들기 먼저 finterstellar가 처음이라면 이전 글을 보고 와주세요. Envelope Envelope는 주가를 감싸고 있어서 붙은 이름입니다. 그림처럼 주가의 위아래를 감싸고 있습니다. 가운데 이동평균선을 중심으로 각각 ±X%의 선을 만든 것입니다. 보통 위에 있는 선을 저항선, 아래에 있는 선을 지지선이라 부릅니다. Envelope를 사용한 투자전략은 모멘텀, 평균회귀에 모두 사용될 수 있습니다. 모멘텀 투자를 한다면 주가가 envelope를 상향 돌파하면 매수하여 다시 envelope 안으로 들어가면 매도를 할 것이고, 평균회귀 투자를 한다면 주가가 envelope의 아래쪽.. 2021. 12. 11. [Python] Getting Started with Kaggle Kaggle is the most famous machine learning competition site. Sign Up Let's visit the site and sign up. Kaggle: Your Machine Learning and Data Science Community Kaggle is the world’s largest data science community with powerful tools and resources to help you achieve your data science goals. www.kaggle.com Overview Now, you can see this screen. Competitions: You can select competitions that you w.. 2021. 12. 11. [Python] finterstellar를 사용하여 MACD로 주식 매매 시그널 만들기 2021.12.09 - [Python] - [Python] finterstellar를 사용하여 RSI로 주식 매매 시그널 만들기 먼저 핀터스텔라가 처음이라면 이전 글을 보고 와주세요. MACD (Moving Average Convergence Divergence) MACD는 이동평균수렴확산지수라고 말하며, 대표적인 보조 지표 중 하나입니다. MACD를 계산할 때 MA(Moving Average)를 사용하여 주가 추이를 보면, 몇 일간의 누적 데이터가 필요하므로 실제 추이보다 늦어질 수 밖에 없습니다. 이를 해결하기 위해 최근의 데이터에 더 높은 가중치를 주고 계산한 EMA(Exponential Moving Average)를 사용합니다. 이 EMA를 사용하여 MACD의 보조 지표들을 계산할 수 있습니다. .. 2021. 12. 10. 이전 1 ··· 11 12 13 14 15 16 17 ··· 39 다음