Use matplotlib.pyplot.table to add tables to your #matplotlib plot. You can even generate an image containing only the table!https://t.co/nsw6PFJjSu#python
— Daily Python Tip (@python_tip) December 10, 2018
Use matplotlib.pyplot.table to add tables to your #matplotlib plot. You can even generate an image containing only the table!https://t.co/nsw6PFJjSu#python
— Daily Python Tip (@python_tip) December 10, 2018
#pythontip from @kenessajr:
— Daily Python Tip (@python_tip) December 2, 2018
To implement a switch-case statement in #Python, you can use a dictionary of lambda functions as in @kenessajr's example. https://t.co/GuHwtkEkce
re.X or re.VERBOSE flag allow you to write regular expression in a more readable way, allowing you to visually separate sections and insert comments.https://t.co/KVgg5aFP2fhttps://t.co/hpNLkCTKWL
— Daily Python Tip (@python_tip) November 28, 2018
#Python3 pathlib is awesome. You can join paths by '/' operator:
— Daily Python Tip (@python_tip) November 21, 2018
data_folder = Path("my_project/data/")
file_to_open = data_folder/"raw_data.txt"
Moreover, you can directly get a content of the file, for example,
print(file_to_open.read_text())https://t.co/MnvcCCtbHz
Moving files from/to a notebook running on a remote server can be painful. But for Colab (Google's flavor of Jupyter), there is an easy way to connect your Google Drive:
— Daily Python Tip (@python_tip) November 20, 2018
from google.colab import drive
drive.mount('/content/drive')
Now you can even see it in your Files panel. pic.twitter.com/BFEGDo9G1S
Pick your abstractions wisely. Everything else flows from them. Pick simple, clear, consistent ones. Ideally, settle on just one.
— François Chollet (@fchollet) November 19, 2018
Find the location of #Jupyter default startup script folder:
— Daily Python Tip (@python_tip) November 18, 2018
get_ipython().profile_dir.startup_dir
Python scripts in this folder will be run in lexicographical order.#jupyter #pythontip
TIL tidyr::uncount(), which does the opposite of dplyr::count()#RStats pic.twitter.com/ePoOgYlX8b
— Colin Fay 🤘 (@_ColinFay) November 16, 2018
If your data is in a dictionary, perhaps from a JSON file, then str.format_map() is your best friend
— Daily Python Tip (@python_tip) November 16, 2018
Pretty way
print('{name} works at {status} {company}'.format_map(info))
Less pretty
print(f'{info["name"]} works at {info["status"]} {info["company"]}')https://t.co/HO9ixnRsrf
Remember the LOCKSS principle: lots of copies keeps stuff safe! https://t.co/pDleFDLCau
— Hadley Wickham (@hadleywickham) November 14, 2018
Great practice for answering questions: show how you found the answer, so the question asker can learn about new resources - @dataandme #rstatsdc pic.twitter.com/0WBEITWdtR
— Emily Robinson (@robinson_es) November 9, 2018
Great advice from @jimmyczech: if you want to get started with #rstats, use a dataset you’re interested in, not mtcare. One possibility - download your social media or gmail data! #rstatsdc pic.twitter.com/QxAV6QHtcp
— Emily Robinson (@robinson_es) November 8, 2018