-
Notifications
You must be signed in to change notification settings - Fork 4
/
hotstar_hack.py
30 lines (22 loc) · 922 Bytes
/
hotstar_hack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# hotstar dataset - India Hack
# author: Rishu Shrivastava (rishu.shrivastava@gmail.com)
# last modified: June 17, 2017
# imports
import numpy as np
import pandas as pd
import json
#read JSON dataset
# hotstar_train = pd.read_json('C:/Users/Rishu/Documents/GitHub/MLPy/data/hotstar/train_data.json')
hotstar_file_train = '~/Desktop/dATA/5f828822-4--4-hotstar_dataset/train_data.json'
with open(hotstar_file_train) as hotstar_json_file:
dict_train = json.load(hotstar_json_file)
# converting json dataset to dataframe
train = pd.DataFrame.from_dict(dict_train, orient='index')
train.reset_index(level=0, inplace=True)
train.rename(columns = {'index':'ID'},inplace=True)
#print(train.shape)
#print(train.head())
print(train.info())
# print(train.stack().unique())
# print(train.stack().unique())
#train.to_csv('C:/Users/Rishu/Desktop/dATA/5f828822-4--4-hotstar_dataset/csv_train.csv', sep=',', encoding='utf-8')