You have to already have these in your system:
- Python. Version 3.6+ is highly recommended.
- Official CPython from python.org
- Anaconda
- (Recommended) Miniconda
| """Hack to add per-session state to Streamlit. | |
| Usage | |
| ----- | |
| >>> import SessionState | |
| >>> | |
| >>> session_state = SessionState.get(user_name='', favorite_color='black') | |
| >>> session_state.user_name | |
| '' |
| import re | |
| def cjk_detect(texts): | |
| # korean | |
| if re.search("[\uac00-\ud7a3]", texts): | |
| return "ko" | |
| # japanese | |
| if re.search("[\u3040-\u30ff]", texts): | |
| return "ja" |
You have to already have these in your system:
| """A Simple Strategy Trading Two Stocks | |
| Original code: https://blog.csdn.net/qq_26948675/article/details/80016633 | |
| Modified based on: https://www.backtrader.com/blog/posts/2018-04-22-improving-code/improving-code.html | |
| Replaced the local CSV files with online data from IEX. | |
| Unfortunately, this strategy is not profitable for the two stocks picked. | |
| """ |
Default ggplot2 aesthetics by geom.
| geom | alpha | angle | colour | family | fill | fontface | height | hjust | lineheight | linetype | shape | size | stroke | vjust | weight | width | xmax | xmin | ymax | ymin |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GeomAbline | NA | black | 1 | 0.5 | ||||||||||||||||
| GeomAnnotationMap | NA | NA | grey20 | 1 | 0.5 | |||||||||||||||
| GeomArea | NA | NA | grey20 | 1 | 0.5 | |||||||||||||||
| GeomBar | NA | NA | grey35 | 1 | 0. |
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Tue Apr 24 16:30:42 2018 | |
| @author: deargle | |
| """ | |
| from sklearn.feature_extraction.text import TfidfVectorizer | |
| from nltk.stem.porter import PorterStemmer | |
| import nltk |
| train.visit_date = pd.to_datetime(train.visit_date) | |
| test.visit_date = pd.to_datetime(test.visit_date) | |
| def add_weather(dataset): | |
| print('Adding weather...') | |
| air_nearest = pd.read_csv( | |
| '../../data/raw/weather/air_store_info_with_nearest_active_station.csv') | |
| unique_air_store_ids = list(dataset.air_store_id.unique()) | |
| weather_dir = '../../data/raw/weather/1-1-16_5-31-17_Weathe |
| <div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } /> |