Thank you 😊 So to Sum up, we can filter data in pandas through: - Boolean Mask, - loc (and unnecessarily iloc), - query(), - lambda, - isnull, and which you discussed in detail in the next video, Thx body 🙂 🙂
In the lambda df{df.apply(lambda x :x["City"] =="Houston" and x["Category"] == "Technology", axis = 1)] how can I add one more value to Category (x["Category"] == "Technology" and "Office Supplies, axis = 1] for example? Similar that the example that you show on excel filtering multiple values in two different columns
Hi, if the date is stored in string format then try to convert using pd.to_datetime or you can use datetime index and strptime method to convert string in date time object
@@mcquezchima6402 Thanks. We can apply filter by couple of ways: 1.) df1["Order Date"] = pd.to_datetime(df['Order Date']) df[df1['Order Date'].dt.year == 2008] 2.) df[df['Order Date'].str.contains('2008')] Try and let me know.
I have multiple conditions to validate. if ‘Country’ column has specific value and ‘Age’ column is less than 11 or ‘DOB’ column has date after 2010 or ‘Comments’ column contains few different strings from a list and create a new column that prints value ‘Valid’ if all conditions meet else prints ‘Invalid’. Need to define a function and apply to multiple data frames. I’m so lost
Thanks for you comment. First of all try to apply filter on country , age and DOB column right, it is easy, and I explained in the video, after that you can go for other condition with the same logic.
Thank you 😊
So to Sum up, we can filter data in pandas through:
- Boolean Mask,
- loc (and unnecessarily iloc),
- query(),
- lambda,
- isnull, and which you discussed in detail in the next video,
Thx body 🙂 🙂
awesome content with nice explanation !! thx !!
Glad you liked it!
Thanks Sir 😊😊 very informative session..👍👍👍👍
I am happy, its useful for you.
Wow.. Very beautifully explained... Now my data filter concept is clear...
Great 👌
This was amazing
Very nice explained
hey bro thank you, you did it as ur channel name...!!
Thanks Hanumant..... 😊
So declarative vedio thanks ...sir
this is very nice video. Thank you so much
very well explain thanx
Thanku sir for such kind of information that you are provinding through your vedios
thank you very much
Can u please show how to folder based on OrderDate
I am facing problems to merge two dataframe will you hepe ???
>700 and =
In the lambda df{df.apply(lambda x :x["City"] =="Houston" and x["Category"] == "Technology", axis = 1)] how can I add one more value to Category (x["Category"] == "Technology" and "Office Supplies, axis = 1] for example?
Similar that the example that you show on excel filtering multiple values in two different columns
date was stored in string format in dataframe. I am struggling on Converting string to date and filtering
Hi, if the date is stored in string format then try to convert using pd.to_datetime or you can use datetime index and strptime method to convert string in date time object
@@ProgrammingIsFunn so sweet of you. I have got answer under this video. You have replied for some one else. Thanks
How to filter by date
df[df['Column Name'] == 'YourDate'] see below example:-
df[df['Order Date'] == '2016-11-08']
@@ProgrammingIsFunn thanks and nice content.
I have a file with data's from 2008 to 2012 but I just want to select data for 2010 how do I go about it
@@mcquezchima6402 Thanks.
We can apply filter by couple of ways:
1.)
df1["Order Date"] = pd.to_datetime(df['Order Date'])
df[df1['Order Date'].dt.year == 2008]
2.)
df[df['Order Date'].str.contains('2008')]
Try and let me know.
@@ProgrammingIsFunn first one worked out thanks
@@ProgrammingIsFunn awesome. case1 worked for me.
Where are the sample files you use in your examples?
Vimal, it is mentioned in the description of video.
And I am sharing here also.
DataSet: github.com/AbhisheakSaraswat/RawData/blob/main/Superstore.xls
I have multiple conditions to validate. if ‘Country’ column has specific value and ‘Age’ column is less than 11 or ‘DOB’ column has date after 2010 or ‘Comments’ column contains few different strings from a list and create a new column that prints value ‘Valid’ if all conditions meet else prints ‘Invalid’. Need to define a function and apply to multiple data frames. I’m so lost
Thanks for you comment. First of all try to apply filter on country , age and DOB column right, it is easy, and I explained in the video, after that you can go for other condition with the same logic.
Very informative and too much information in one video , keep posting videos