I have the following code:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import csv
data1=pd.read_csv('11-01 412-605.csv', low_memory=False)
d412=pd.DataFrame(data1, columns=['size', 'price', 'date'])
new_df = pd.value_counts(d412['size']).reset_index()
new_df.columns = ['size', 'frequency']
print (new_df)
export_csv = new_df.to_csv ('empty.csv', index = None, header=True)
Which outputs: output However, I want to print out the values that only have a count of 1-1000. How do I do that because right now it prints out all the values. I tried:
new_df = pd.value_counts(d412['size']<1000).reset_index()
But that does not work as it prints out true or false for all values less than 1000
try
print(new_df.loc[df_new['frequency']<1000,:])
if i misunderstood the columns of the count please substitute 'frequency' with 'size'