MAINT: Convert dictionary .values() to list for python3

This commit is contained in:
Cam Sweeney
2018-01-11 10:36:44 -08:00
parent ff7d7c5256
commit 050fda1bdb
10 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ def handle_data(context, data):
def analyze(context, perf):
# Get the base_currency that was passed as a parameter to the simulation
base_currency = context.exchanges.values()[0].base_currency.upper()
base_currency = list(context.exchanges.values())[0].base_currency.upper()
# First chart: Plot portfolio value using base_currency
ax1 = plt.subplot(411)
+1 -1
View File
@@ -161,7 +161,7 @@ def analyze(context=None, perf=None):
import matplotlib.pyplot as plt
# The base currency of the algo exchange
base_currency = context.exchanges.values()[0].base_currency.upper()
base_currency = list(context.exchanges.values())[0].base_currency.upper()
# Plot the portfolio value over time.
ax1 = plt.subplot(611)
@@ -161,7 +161,7 @@ def analyze(context=None, perf=None):
import matplotlib.pyplot as plt
# The base currency of the algo exchange
base_currency = context.exchanges.values()[0].base_currency.upper()
base_currency = list(context.exchanges.values())[0].base_currency.upper()
# Plot the portfolio value over time.
ax1 = plt.subplot(611)
+1 -1
View File
@@ -175,7 +175,7 @@ def handle_data(context, data):
def analyze(context=None, results=None):
import matplotlib.pyplot as plt
base_currency = context.exchanges.values()[0].base_currency.upper()
base_currency = list(context.exchanges.values())[0].base_currency.upper()
# Plot the portfolio and asset data.
ax1 = plt.subplot(611)
results.loc[:, 'portfolio_value'].plot(ax=ax1)
+1 -1
View File
@@ -57,7 +57,7 @@ def analyze(context, perf):
log.info('the stats: {}'.format(get_pretty_stats(perf)))
# The base currency of the algo exchange
base_currency = context.exchanges.values()[0].base_currency.upper()
base_currency = list(context.exchanges.values())[0].base_currency.upper()
# Plot the portfolio value over time.
ax1 = plt.subplot(611)
+1 -1
View File
@@ -41,7 +41,7 @@ from catalyst.exchange.utils.exchange_utils import get_exchange_symbols
def initialize(context):
context.i = -1 # minute counter
context.exchange = context.exchanges.values()[0].name.lower()
context.exchange = list(context.exchanges.values())[0].name.lower()
context.base_currency = context.exchanges.values()[0].base_currency.lower()