👋 Hey there, I am Waylon Walker
I am a Husband, Father of two beautiful children, Senior Python Developer currently working in the Data Engineering platform space. I am a continuous learner, and sha
Great post, I had no idea there was a clear() method. You're missing out on one of my favorite features though! The * operator. I commonly use it along side list comprehensions.
For example take a pandas DataFrame and get all of the columns that include "price" in their name.
👋 Hey there, I am Waylon Walker
I am a Husband, Father of two beautiful children, Senior Python Developer currently working in the Data Engineering platform space. I am a continuous learner, and sha
Lol, good catch. 😳 I think I took a break between the comment and finding a good example. Here is a real example of nearly the same thing if the DataFrame was a pyspark DataFrame. pyspark.select takes in column names as *argsdf.select('us_price', 'eu_price')
They can be selected programatically with a list comprehension and *unpacking.
👋 Hey there, I am Waylon Walker
I am a Husband, Father of two beautiful children, Senior Python Developer currently working in the Data Engineering platform space. I am a continuous learner, and sha
Great post, I had no idea there was a
clear()
method. You're missing out on one of my favorite features though! The*
operator. I commonly use it along side list comprehensions.For example take a pandas
DataFrame
and get all of the columns that include"price"
in their name.Thanks for reading.
You mean make a filtered list with lost comprehension?
Or you mean using * to repeat items?
Lol, good catch. 😳 I think I took a break between the comment and finding a good example. Here is a real example of nearly the same thing if the DataFrame was a pyspark DataFrame. pyspark.select takes in column names as
*args
df.select('us_price', 'eu_price')
They can be selected programatically with a list comprehension and *unpacking.
I see. The list comprehension is used as a predicate?
Not sure what you mean by predicate, the list comprehension is a filter.
Here is a generally relatable example using the print statement
That makes sense. I haven't seen this documented in many places. That's probably why I missed this.