Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # coding: utf-8
- # In[44]:
- import pandas as pd
- import numpy as np
- import json
- # In[30]:
- with open('123.json', encoding="utf8") as f:
- s1 = json.load(f)
- # In[31]:
- s2 = json.dumps(s1)
- dataLite = json.loads(s2)
- # In[ ]:
- dataF = pd.DataFrame(dataLite['rows'])
- # In[37]:
- dataF.columns = ['nameG', 'name', 'unixDate', 'viewersCount']
- pd.read_json()
- # In[39]:
- with open('GamesAndChannels.json', encoding="utf8") as f:
- gc1 = json.load(f)
- gc2 = json.dumps(gc1)
- dataGC = json.loads(gc2)
- # In[40]:
- games = pd.DataFrame(dataGC['games'])
- # In[41]:
- channels = pd.DataFrame(dataGC['channels'])
- # In[77]:
- games = games.rename(columns={'name': 'nameG'})
- games.iloc[1000:1010]
- # In[76]:
- channels = channels.rename(columns={'name': 'nameC'})
- channels.iloc[1000:1010]
- dataF["idGame"] = np.nan
- dataF["idChannel"] = np.nan
- # In[46]:
- dataF
- dataF['test'] = np.where(games['nameG'] == 1, df.index, '')
- # In[ ]:
- df.query('Column == 17').index.tolist()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement