Skip to content

Instantly share code, notes, and snippets.

View Parv3sh's full-sized avatar
💭
Ancora imparo

Parvesh Kumar Parv3sh

💭
Ancora imparo
View GitHub Profile
@Parv3sh
Parv3sh / install_pyenv.sh
Created December 22, 2020 05:29 — forked from hemna/install_pyenv.sh
install pyenv and then install python 3.6.3 in that pyenv
# !/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
@Parv3sh
Parv3sh / iterm2-solarized.md
Created October 26, 2019 08:34 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@Parv3sh
Parv3sh / gist:64799b3bcb1ece7136d597cd43a622f6
Created September 24, 2019 23:02 — forked from rafaan/gist:4ddc91ae47ea46a46c0b
Convert Nested JSON to Pandas DataFrame and Flatten List in a Column
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'])
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):