This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # !/bin/bash | |
| # Step 1. Install pyenv | |
| git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
| echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
| echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
| echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc | |
| source ~/.bashrc | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import json | |
| from pandas.io.json import json_normalize | |
| import pandas as pd | |
| with open('C:\filename.json') as f: | |
| data = json.load(f) | |
| df = pd.DataFrame(data) | |
| normalized_df = json_normalize(df['nested_json_object']) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from itertools import chain, starmap | |
| def flatten_json_iterative_solution(dictionary): | |
| """Flatten a nested json file""" | |
| def unpack(parent_key, parent_value): | |
| """Unpack one level of nesting in json file""" | |
| # Unpack one level only!!! | |
| if isinstance(parent_value, dict): | 

