title: Python json.decoder.JSONDecodeError
body: <p>I am trying to do a json reader and then it will draw a bar chart. But I couldn't understand where the problem is.</p>
  
  <pre><code>import json
  from argparse import  ArgumentParser
  import dateutil.parser
  import numpy as np
  import pandas as pd
  import matplotlib.pyplot as plt
  from datetime import datetime
  
  def get_parser():
      parser = ArgumentParser()
      parser.add_argument('--file', '-f', required=True, help='The .jsonl file with all the posts')
      return parser
  
  if __name__ == '__main__':
      parser = get_parser()
      args = parser.parse_args()
      with open(args.file) as f:
          posts = []
          for line in f:
              post = json.loads(line)
              created_time = dateutil.parser.parse(post['created_time'])
              posts.append(created_time.strftime('%H:%M:%S'))
          ones = np.ones(len(posts))
          idx = pd.DatetimeIndex(posts)
          my_series = pd.Series(ones, index=idx)
          per_hour = my_series.resample('1H').sum().fillna(0)
          fig, ax =plt.sublots()
          ax.grid(True)
          ax.set_title("Post Frequencies")
          width = 0.8
          ind = np.arange(len(per_hour))
          plt.bar(ind, per_hour)
          tick_pos = ind + width / 2
          labels = []
          for i in range(24):
              d = datetime.now().replace(hour=i, minute=0)
              labels.append(d.strftime('%H:%M'))
          plt.xticks(tick_pos, labels, rotation=90)
          plt.savefig('posts_per_hours.png')
  </code></pre>
  
  <p>I got </p>
  
  <pre><code>Traceback (most recent call last):
    File "deneme1.py", line 20, in &lt;module&gt;
      post = json.loads(line)
    File "C:\Users\Nulla\AppData\Local\Programs\Python\Python37\lib\json\__init__.py", line 348, in loads
      return _default_decoder.decode(s)
    File "C:\Users\Nulla\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:\Users\Nulla\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 353, in raw_decode
      obj, end = self.scan_once(s, idx)
  json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2)
  </code></pre>
  
  <p>this error everytime when I try to run in CMD. </p>
  
  <p>I also got another error on PyCharm when I try to Run</p>
  
  <pre><code>usage: deneme1.py [-h] --file FILE
  deneme1.py: error: the following arguments are required: --file/-f
  </code></pre>