To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/ThePyCoach/. The first 200 of you will get 20% off Brilliant’s annual premium subscription.
I've just added the link of the files to the description. Since it was a very small tutorial, I didn't upload the code to github, but you can get the same code from my Medium article (link on the description)
Its weird seeing the use of & in the filter expressions as a logical and rather than a bitwise and. But realized its because python only supports overloading the bitwise operators with __and__, __or__, and __xor__ methods and there is no way to overload the logical and, or and xor operators.
nice video, thanks. Any idea. how i can change the datatype of a column which has a datatime in it but is datatype string. I want to change it to datetime
df = df.with_column(pl.col("date").alias("date_string").cast(pl.Object)) df = df.with_column(pl.col("date_string").to_datetime(pl.Date32)) According to chatgpt
if the name of your dataframe is 'df' and the name of the column which may contain nulls is called 'col_a' then this is the code : df = df.with_columns( pl.col('col_a').fill_null('your string here'') )
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/ThePyCoach/. The first 200 of you will get 20% off Brilliant’s annual premium subscription.
great explanation! Thanks so much for your efforts.
I don't see the CSV files you used during the video. Will you also share the Jupyter notebook, please? Thank you for creating and sharing this video.
I've just added the link of the files to the description. Since it was a very small tutorial, I didn't upload the code to github, but you can get the same code from my Medium article (link on the description)
@@ThePyCoach Thank you.
I have installed polars but python crashes at import polars as pl when I'm trying to run it with my pysimplegui application.
Its weird seeing the use of & in the filter expressions as a logical and rather than a bitwise and. But realized its because python only supports overloading the bitwise operators with __and__, __or__, and __xor__ methods and there is no way to overload the logical and, or and xor operators.
Can I read csv from url using polars?
benchmarking against Pandas1 is not fair. Because Pandas is moving towars Arrow-backend and everyone should use Pandas 2 with Arrow as storage.
nice video, thanks. Any idea. how i can change the datatype of a column which has a datatime in it but is datatype string. I want to change it to datetime
df = df.with_column(pl.col("date").alias("date_string").cast(pl.Object))
df = df.with_column(pl.col("date_string").to_datetime(pl.Date32))
According to chatgpt
@@JustRollin thx to be honest ;)
@@JustRollin wut? Don't convert to pl.Object. Your code doesn't even work!
Just do `df.with_columns(pl.col("date_string").str.to_datetime())`
@@JustRollin boo, don't regurgitate answers you don't understand and are possibly wrong.
How to arrange the columns in this new library as per requirement
Simply brilliant! Thank you. Liked & Subd.
Great video thanks!! ❤
Anyone please suggest how to update null values with some string in Polars.
if the name of your dataframe is 'df' and the name of the column which may contain nulls is called 'col_a' then this is the code :
df = df.with_columns(
pl.col('col_a').fill_null('your string here'')
)
Cuando tendrás un curso de Polars en Udemy?
Great Python clip for me!!!
Es básicamente spark?
Almost similar syntaxes like pyspark
Reminds me of pyspark
Bye bye pandas
I guess this is not informative, it seems like adversiting ;)
yeah...felt the same..
reading from s3?