I have a dataframe with 6 column the first one of which represents a Date.
I want to select only the rows with a specific date represented in the first column, how should I do ?
The dataframe is loaded via read_csv and contains 6 columns , as strings , the first one represents a Date and the remaining ones are representing integers
I was using :
df['Data' == '....'] which I found somewhere around the net
Initially the first column , 'Data', was included in the index_col=[] list in the read_csv : I kept getting error on that same column, so figuring it could be caused by the index_col list, I completely eliminated it, to no avail. After that I tried thousands of other methods , none of them worked .
Is there a way to do it or should i simply give up the idea ?
This is the code :
l = [{'Data' : '2023-07-11','Val1':'2','Val2' :'23', 'Val3':'2','P':'0','Totals':'12'},
{'Data' : '2023-08-01','Val1':'3','Val2' :'0', 'Val3':'21','P':'0','Totals':'2'},
{'Data' : '2023-01-09','Val1':'4','Val2' :'41', 'Val3':'51','P':'1','Totals':''},
{'Data' : '2023-04-12','Val1':'5','Val2' :'210', 'Val3':'30','P':'0','Totals':'1'},
]
orig_df_stats = pd.DataFrame(l)
print (orig_df_stats)
print (orig_df_stats['Data' == '2023-07-11'])