Jovian
⭐️
Sign In
In [43]:
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import matplotlib
from datetime import datetime

# import ipywidgets as widgets
# from ipywidgets import interact, interact_manual

# import plotly
# import plotly.tools as tls
# import plotly.graph_objs as go
# import plotly.io as pio
# from plotly.offline import download_plotlyjs, init_notebook_mode, iplot, plot
# from IPython.display import Image

from functools import reduce

시간순서가 있는 데이터

In [2]:
font = {'family' : 'normal',
        'weight' : 'bold',
        'size'   : 18}

matplotlib.rc('font', **font)
In [ ]:
 
In [3]:
final_prcessed2 = pd.read_csv('./dataSet/final_prcessed2.csv')
final_prcessed2 = final_prcessed2.drop(["Unnamed: 0"], axis=1)
final_prcessed2 = final_prcessed2.reset_index(drop=True)
In [4]:
final_prcessed2["time"]=pd.to_datetime(final_prcessed2["data"], format='%Y%m%d%H%M%S')
final_prcessed2=final_prcessed2.drop(["data"], axis=1)
In [5]:
final_prcessed2['new_date'] = [d.date() for d in final_prcessed2['time']]
final_prcessed2['new_time'] = [d.time() for d in final_prcessed2['time']]
In [6]:
grouped = final_prcessed2.groupby("new_date")

weekendFiltered=grouped.filter(lambda x: len(x) > 5)

# weekendFiltered = final_prcessed2.copy()
In [14]:
top_5=final_prcessed2.groupby("userId").size().nlargest(5).index
In [45]:
data = ['a', 'a', 'a', 'b', 'b', 'c', 'c', 'c']
In [47]:
reduce(lambda a, b: a.update({b : a.get(b, 0) + 1}) or a,
      data, {})
Out[47]:
{'a': 3, 'b': 2, 'c': 3}
In [48]:
!pip install jovian -q --upgrade
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
In [50]:
import jovian
In [51]:
jovian.commit()
[jovian] Saving notebook..
[jovian] Creating a new notebook on https://jovian.ml/ [jovian] Please enter your API key ( from https://jovian.ml/ ):
API Key: ·····················································································································································································································································································································
[jovian] Uploading notebook.. [jovian] Capturing environment.. [jovian] Committed successfully! https://jovian.ml/chahyoil/6d938d29869f410a9f5e3388d26c77bc
[jovian] Error: Failed to read Anaconda environment using command: "conda env export -n base --no-builds"
In [ ]: