aiqtech commited on
Commit
b851497
ยท
verified ยท
1 Parent(s): 5af2ada

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -5,20 +5,17 @@ from pypfopt.discrete_allocation import DiscreteAllocation, get_latest_prices
5
  from pypfopt import EfficientFrontier
6
  from pypfopt import risk_models
7
  from pypfopt import expected_returns
 
 
 
 
 
 
8
  from pypfopt import plotting
9
  import copy
10
  import numpy as np
11
  import pandas as pd
12
  import plotly.express as px
13
- from pypfopt import plotting
14
- import matplotlib.pyplot as plt
15
-
16
- try:
17
- plt.style.use("seaborn-deep")
18
- except OSError:
19
- print("'seaborn-deep' ์Šคํƒ€์ผ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ์Šคํƒ€์ผ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.")
20
- plt.style.use("default") # ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์‚ฌ์šฉ
21
-
22
 
23
  def plot_cum_returns(data, title, initial_capital=1000):
24
  # ์ผ์ผ ๋ˆ„์  ์ˆ˜์ต๋ฅ  ๊ณ„์‚ฐ ๋ฐ ์‹œ๊ฐํ™”
 
5
  from pypfopt import EfficientFrontier
6
  from pypfopt import risk_models
7
  from pypfopt import expected_returns
8
+ import matplotlib.pyplot as plt
9
+ if "seaborn-deep" in plt.style.available:
10
+ plt.style.use("seaborn-deep")
11
+ else:
12
+ print("'seaborn-deep' ์Šคํƒ€์ผ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ์Šคํƒ€์ผ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.")
13
+ plt.style.use("default")
14
  from pypfopt import plotting
15
  import copy
16
  import numpy as np
17
  import pandas as pd
18
  import plotly.express as px
 
 
 
 
 
 
 
 
 
19
 
20
  def plot_cum_returns(data, title, initial_capital=1000):
21
  # ์ผ์ผ ๋ˆ„์  ์ˆ˜์ต๋ฅ  ๊ณ„์‚ฐ ๋ฐ ์‹œ๊ฐํ™”