Berichten met #PythonTip

#PythonTip

Openbare berichten op X die #PythonTip gebruiken.

Gerelateerde hashtags

  1. Daily Python Tip 🐍🐧@python_tip
    Did you know that there is an else clause in Python's `for` loops letting you check if the loop encountered a `break`? Example: 👇👇 #pythontip by @bascodes
    Downloaden
    Bas Steins @bascodes
    Did you know that there is an else clause in Python's `for` loops letting you check if the loop encountered a `break`? #pythontip
    1128
  2. Bas Steins✓@bascodes
    Did you know that there is an else clause in Python's `for` loops letting you check if the loop encountered a `break`? #pythontip
    Downloaden
    017
  3. Daily Python Tip 🐍🐧@python_tip
    #pythontip by @RashmikaNawa: How to increase speed when iterating over rows in a DataFrame? Use `itertuples()` instead of `iterrows()`. Also, consider vectorization or `apply()` instead. More info: #pandas #performance
    Rashmika Nawaratne @RashmikaNawa
    Efficient way to iterate through a #python #pandas dataframe: Usual way: for _, row in df.iterrows(): print(row['col_name']) Efficient way: (x200 speedup with .5 mil records) for row in df.itertuples(index=False): print(row[col_location]) @python_tip #performance
    0524
  4. Rashmika Nawaratne@RashmikaNawa
    Efficient way to iterate through a #python #pandas dataframe: Usual way: for _, row in df.iterrows(): print(row['col_name']) Efficient way: (x200 speedup with .5 mil records) for row in df.itertuples(index=False): print(row[col_location]) @python_tip #performance
    01145
  5. Bas Steins✓@bascodes
    💡🐍 Python is a popular language for connecting different data sources. Use a 𝙲𝚑𝚊𝚒𝚗𝙼𝚊𝚙 to get a singular value from a collection of different 𝚍𝚒𝚌𝚝s: #tweet100 #pythontip
    Downloaden
    615109
  6. Daily Python Tip 🐍🐧@python_tip
    The trafilatura web scraping package seamlessly downloads and processes web pages It supports ATOM/RSS feeds, web crawling and various output formats (CSV, JSON, Markdown, XML) Example: 👇👇 #pythontip by @adbarbaresi
    Downloaden
    0925
  7. Daily Python Tip 🐍🐧@python_tip
    #Python Best Practices for a 🆕 Project in 2021: pyenv, poetry, VS code, pytest, pytest-cov, pre-commit, flake8, black, mypy, isort Thanks, @Eli_Krumova, for this #pythontip. Do you want to contribute a tip? Send it to or just mention us in your tweet.
    Sourabh Singh Katoch @SourabhSKatoch
    21531
  8. Daily Python Tip 🐍🐧@python_tip
    Beware of nan!   😱#python >>> sorted([5.0, math.nan, 10.0, 0.0]) [5.0, nan, 0.0, 10.0] >>> sorted([math.nan, 1.0]) [nan, 1.0] >>> sorted([1.0, math.nan]) [1.0, nan] >>> min(3, math.nan, 1) 1 >>> min(math.nan, 3, 1) nan #pythontip by @raymondh
    4947
  9. Daily Python Tip 🐍🐧@python_tip
    #pythontip by @raymondh: A specialized tool often beats a general purpose tool * math.sqrt(x) is more accurate than x ** 0.5 * math.log2(x) is more accurate than math.log(x, 2) * math.log1p(x) is more accurate than math.log(1+x) ... For example (see the figure)
    Downloaden
    01445
  10. Mike Driscoll✓@driscollis
    #PythonTip 🐍🔥 Use `pathlib` to list all the files of a specific type in a folder. Here's an example:
    Downloaden
    41315.3K
  11. Daily Python Tip 🐍🐧@python_tip
    #pythontip by @bascodes: To avoid unintended consequences, change your function defaults arguments from (first figure) to (second figure). Otherwise, calling the function without that optional argument will access the same list each time.
    Downloaden
    31563
  12. Meer berichten tonen