small tweaks
This commit is contained in:
BIN
.spending_summary.md.swp
Normal file
BIN
.spending_summary.md.swp
Normal file
Binary file not shown.
@@ -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'],
|
||||||
|
|||||||
Reference in New Issue
Block a user