LaVOZs

The World’s Largest Online Community for Developers

'; python - I use Pandas mask in order to take a data from dataframe by using input dates but start date's date is not appear - LavOzs.Com

Goal is simple what I want is to get two date inputs and take some datas from a dataframe. Here is the code.

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime

plt.rc('font', family = 'Malgun Gothic')
df = pd.read_csv('seoul.csv', encoding = 'cp949', index_col=False)
df.style.hide_index()
del df['지점']

a = input("날짜 입력 yyyy-mm-dd: ")
b = input("날짜 입력 yyyy-mm-dd: ")

df['날짜'] = pd.to_datetime(df['날짜'])
mask = (df['날짜']>a) & (df['날짜']<=b)
df2.loc[mask,['날짜','최고기온(℃)']]

And here is inputs and the result.

Inputs_and_the_result

How can I make the result begin from the start date that i put in?

mask = (df['날짜']>=a) & (df['날짜']<=b)

yet i am an idiot

Related
Converting a Pandas GroupBy output from Series to DataFrame
How to take column-slices of dataframe in pandas
Select by partial string from a pandas DataFrame
Delete column from pandas DataFrame
Constructing pandas DataFrame from values in variables gives “ValueError: If using all scalar values, you must pass an index”
Get list from pandas DataFrame column headers
How do I create test and train samples from one dataframe with pandas?
Cannot display HTML string