{"cells":[
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": "# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\n\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nfrom subprocess import check_output\nprint(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n\n\nimport os\nimport numpy as np\nimport pandas as pd\nfrom pylab import *\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom bokeh.plotting import figure, output_file, show\nimport matplotlib.pyplot as plt\nimport matplotlib.mlab as mlab\nfrom matplotlib.colors import LogNorm\n\n# Any results you write to the current directory are saved as output.\nprint('done')\ntrain_dir = \"../input\"\ntrain_file = \"train.csv\"\nfbcheckin_train_tbl = pd.read_csv(os.path.join(train_dir, train_file))\n\n\n# Assuming time values were time elapsed epoch times. we can now calculate the hours, minutes, days and seconds from last checkin \n\nfbcheckin_train_tbl['timeinmin'] = fbcheckin_train_tbl['time']\nfbcheckin_train_tbl['time_of_week'] = fbcheckin_train_tbl['time'] % 10080\nfbcheckin_train_tbl['day_of_week'] = fbcheckin_train_tbl['time_of_week'] / 1440\nfbcheckin_train_tbl['hour_of_day']  = (fbcheckin_train_tbl['time_of_week'] / 60) % 24\n\n\none_id = fbcheckin_train_tbl[fbcheckin_train_tbl['place_id']==8523065625]['timeinmin'] % (10080) //60.\nn, bins, patches = plt.hist(one_id, 168 , histtype='bar')\nplt.show()\n"
 },
 {
  "cell_type": "code",
  "execution_count": null,
  "metadata": {
   "collapsed": false
  },
  "outputs": [],
  "source": ""
 }
],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}}, "nbformat": 4, "nbformat_minor": 0}