Skip to content

Commit 4e50339

Browse files
tabs to spaces in reading
1 parent 4a30452 commit 4e50339

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

source/reading.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,8 @@ of the nasa_data object. But you can reproduce this using the DEMO_KEY key -->
14691469
import requests
14701470

14711471
nasa_data_single = requests.get(
1472-
"https://api.nasa.gov/planetary/apod?api_key=YOUR_API_KEY&date=2023-07-13"
1473-
).json()
1472+
"https://api.nasa.gov/planetary/apod?api_key=YOUR_API_KEY&date=2023-07-13"
1473+
).json()
14741474
nasa_data_single
14751475
```
14761476

@@ -1492,8 +1492,8 @@ and there will be 74 items total, one for each day between the start and end dat
14921492

14931493
```python
14941494
nasa_data = requests.get(
1495-
"https://api.nasa.gov/planetary/apod?api_key=YOUR_API_KEY&start_date=2023-05-01&end_date=2023-07-13"
1496-
).json()
1495+
"https://api.nasa.gov/planetary/apod?api_key=YOUR_API_KEY&start_date=2023-05-01&end_date=2023-07-13"
1496+
).json()
14971497
len(nasa_data)
14981498
```
14991499

@@ -1513,17 +1513,17 @@ readers who would like to parse JSON data into a `pandas` data frame in their ow
15131513

15141514
```{code-cell} ipython3
15151515
data_dict = {
1516-
"date":[],
1517-
"title": [],
1518-
"copyright" : [],
1519-
"url": []
1516+
"date":[],
1517+
"title": [],
1518+
"copyright" : [],
1519+
"url": []
15201520
}
15211521
15221522
for item in nasa_data:
1523-
if "copyright" not in item:
1524-
item["copyright"] = None
1525-
for entry in ["url", "title", "date", "copyright"]:
1526-
data_dict[entry].append(item[entry])
1523+
if "copyright" not in item:
1524+
item["copyright"] = None
1525+
for entry in ["url", "title", "date", "copyright"]:
1526+
data_dict[entry].append(item[entry])
15271527
15281528
nasa_df = pd.DataFrame(data_dict)
15291529
nasa_df

0 commit comments

Comments
 (0)