small tweaks

This commit is contained in:
2017-05-24 13:53:07 -04:00
parent ffc650e9db
commit bed7b4acd4
2 changed files with 3 additions and 1 deletions

BIN
.spending_summary.md.swp Normal file

Binary file not shown.

View File

@@ -97,7 +97,7 @@ Inspecting the output of `get_some_transactions`, we see that there are multiple
``` ```
## Get **The Right** Transactions ## Get **The Right** Transactions
Looking at the transactions themselves, we see that there is a `category` field which sometimes has a list of values, sometimes `None`. Looking at the transactions themselves, we see that there is a `category` field which sometimes has a list of values, sometimes `None`. What are the categories?
```python ```python
>>> some_transactions['transactions'].keys() >>> some_transactions['transactions'].keys()
@@ -161,6 +161,8 @@ def get_some_transactions(access_token: str, start_date: str, end_date: str) ->
Now there are just 265 transactions. Are any of them negative? Now there are just 265 transactions. Are any of them negative?
```python ```python
>>> len(some_transactions)
265
>>> pprint([transaction for transaction in some_transactions if transaction['amount'] < 0]) >>> pprint([transaction for transaction in some_transactions if transaction['amount'] < 0])
[{'amount': -500, [{'amount': -500,
'category': ['Travel', 'Airlines and Aviation Services'], 'category': ['Travel', 'Airlines and Aviation Services'],