[go: nahoru, domu]

Skip to content

Commit

Permalink
Nested_JSON_stocks
Browse files Browse the repository at this point in the history
update and remove extra/dupl info
  • Loading branch information
MrFuguDataScience authored Jan 15, 2021
1 parent beb9dd9 commit 5b5630d
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions viewer_helpJSON.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -519,16 +519,16 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 262,
"metadata": {},
"outputs": [],
"source": [
"df_=pd.DataFrame(stocks)"
"df_02=pd.DataFrame(stocks)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 263,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -633,15 +633,15 @@
"1 158.595 611 "
]
},
"execution_count": 10,
"execution_count": 263,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# import json\n",
"\n",
"pd.json_normalize(json.loads(df_.to_json(orient=\"records\")))"
"pd.json_normalize(json.loads(df_02.to_json(orient=\"records\")))"
]
},
{
Expand All @@ -665,7 +665,7 @@
},
{
"cell_type": "code",
"execution_count": 242,
"execution_count": 267,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -689,19 +689,7 @@
},
{
"cell_type": "code",
"execution_count": 243,
"metadata": {},
"outputs": [],
"source": [
"\n",
"my_df=pd.DataFrame(mystuff)\n",
"\n",
"my_df=my_df.rename(columns={\"t\":\"date\"})\n"
]
},
{
"cell_type": "code",
"execution_count": 244,
"execution_count": 268,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -756,7 +744,7 @@
"1 1610570700 131.05 472.80 158.57"
]
},
"execution_count": 244,
"execution_count": 268,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -774,7 +762,7 @@
},
{
"cell_type": "code",
"execution_count": 245,
"execution_count": 269,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -789,7 +777,7 @@
},
{
"cell_type": "code",
"execution_count": 246,
"execution_count": 270,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -844,7 +832,7 @@
"1 2021-01-13 13:45:00 131.05 472.80 158.57"
]
},
"execution_count": 246,
"execution_count": 270,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit 5b5630d

Please sign in to comment.