It would be great to see a sample of the dataframe, next time you submit a question, it eliminates the guess work.
Taking a look at the limited information you have provided, here are two potentials ways to solve your use case.
Approach 1 - Pandas has a great function called date_range docs. From the docs:
Returns the range of equally spaced time points (where the difference between any two adjacent points is specified by the given frequency) such that they all satisfy start <[=] x <[=] end
import pandas as pd
# Convert the 'date' column to datetime if it's not already in datetime format
df['date'] = pd.to_datetime(df['date'])
# Set 'date' and 'ticker' columns as the index
df.set_index(['date', 'ticker'], inplace=True)
# Select the desired range of dates and the specific ticker
date_range = pd.date_range('2000-01-03', '2000-01-06')
ticker = 'A'
# Use df.loc to filter based on the date range and ticker
selected_data = df.loc[(date_range, ticker), :]
Approach 2 - Slice your dataframe using a boolean
You can use boolean conditions to filter the DataFrame based on the desired date range and ticker. We extract the 'date' and 'ticker' levels from the multi-index using df.index.get_level_values, and then apply the conditions.
# Set 'date' and 'ticker' columns as the index
df.set_index(['date', 'ticker'], inplace=True)
# Select the desired range of dates and the specific ticker using boolean condition
date_start = '2000-01-03'
date_end = '2000-01-06'
ticker = 'A'
selected_data = df.loc[(df.index.get_level_values('date') >= date_start) &
(df.index.get_level_values('date') <= date_end) &
(df.index.get_level_values('ticker') == ticker), :]
Approach 3 - Slicing without creating a multiindex
# Convert the 'date' column to datetime if it's not already in datetime format
df['date'] = pd.to_datetime(df['date'])
# Filter the DataFrame based on date range and ticker
date_start = '2000-01-03'
date_end = '2000-01-06'
ticker = 'A'
selected_data = df.loc[(df['date'] >= date_start) & (df['date'] <= date_end) & (df['ticker'] == ticker)]