title: Split a dictionary data into 2 parts and store into variable
body: <p>So I have this cosine similarity metric dictionary data with me that is stored in the variable 'similarity'. <a href="https://i.stack.imgur.com/NfcMU.png" rel="nofollow noreferrer">PIC of the data </a>.
  May I know how can I split this data into portion of 70 and 30 precents. I want to split this data into two parts and store those two in a variable most preferably the split can be 7:3 division</p>
  <p>The reason i have asking this is I have an accuracy algorithm that gives the accuracy of that data but the problem is that i used same data for training as well as testing as you can see in the code so I receive 100% acc obviously as my training and testing data is same. so wanted to split data into 70 30 percent such  training is 70 and testing is 30.</p>
  <pre><code>print(similarity)
  
  
  train_r =  np.array(similarity)
  test_r =  np.array(similarity)
  
  train_c = train_r[:,10]
  test_c = test_r[:,10]
  
  a = train_c
  b = test_c
  
  cos_sim = (dot(a, b)/(norm(a)*norm(b))) * 100
  print(cos_sim)
  </code></pre>
  <p>It would be really grateful if I can get the answer. Thanks so much</p>