Difference between python --version and python -v. These two commands have completely different purposes: python --version Shows the Python interpreter's version number Example output: Python 3.9.7 This is the standard way to check which version of Python you're running It's equivalent to python -V (capital V) python -v Activates verbose...
For Jupyter Notebooks, the modern approach is: %pip install such as %pip install ShopifyAPI. %pip is a magic command The `%pip is called a "magic command" and it is preferred over `!pip` because it ensures the package is installed in the same Python environment that the kernel is using. But...
How to leverage Python to fill-out the missing dates on a file? Let's see that together!
Not so long ago, I faced an issue while wanted to test a colleague idea: how can we test on which links user are more willing to click. TL;DR If my article is too long, these are the steps: Define the scope Extract or get the HTML content Split your group...
To save a .parquet file with Python, you can use the pandas library, which provides a convenient way to read and write data in a variety of formats, including Parquet. Let me share with you an example: ```Python import pandas as pd create a sample DataFrame data = {'name': ['Alice',...
While reviewing code from a colleague, I came across a -> pd.DataFrame in a Python function. I discovered that this indicates that the function is expected to return a pandas DataFrame.
div> I was recently introduced to .parquet extension files. Let me share with you what I learned! Parquet files are popular for storing and processing large datasets in big data environments. Introduction: a few words about the .parquet Parquet file is a columnar storage file format that is commonly used...
Welcome to AC Consulting, a unique platform where technology meets innovation. AC Consulting is not just a business; it's a passion project, a side hustle, and a tech playground for Arthur Camberlein.
Might be a simple trick, but wanted to share something I am using on a regular basis: unique URL per column on a dataframe and how to export it! I will use pandas so start by importing the libraryimport pandas as pd I am labelling this as Python SEO as...
To read a .parquet file with Python, the pandas library is your friend. In fact, pandas provides a convenient way to read and write data in a variety of formats (you might be familiar with CSV or XLS[X] files), including Parquet.
Another Python and Data post today for you, by me, with the help of what I read on Twitter ... and used. Now it's time to share it with you too!
Let me show you how to make your Streamlit App shine on the Internet!
This import will work if you are using any version of Python (meaning Python 2 or Python 3). How to import a library To import a library, you will have to use import + {the name of your library}. So you could do this to import libraries one by one:...
If you like and enjoy using Notebook for Python (Google Colab, Jupyter, ...), you will be glad that there is a tip that could help you save some time to import files from your computer (or the one from the user of your app/scrip). 2 lines to create a prompt...
Look for, find and delete/remove any empty column in a dataframe thanks to Python. # Find the columns where each value is null empty_cols = [col for col in df.columns if df[col].isnull().all()] # Drop these columns from the dataframe df.drop(empty_cols, axis=1, inplace=True) Find the columns where each value is null...
A handy tip for today—even if you already work with pandas or NumPy: display enriched tables right inside Google Colab. These tips and notebooks are primarily geared toward Python, though you can also spin up notebooks for R scripts. How do you get enriched tables? Google Colab lets you add...
How to know (and display) all columns of a DataFrame in Python Prerequisites We will once again use the (famous) pandas library used in Python. For installation, you have the solutions below: for Python pip install pandas for Python 3 pip3 install pandas You will only need to install your...
import difflib import pandas as pd from datetime import date date = date.today() today = date.strftime("%Y-%m-%d") document = today + "-diff" document_txt = "data/" + document + ".txt" document_csv = "data/" + document + ".csv" with open('robots-live.txt') as robots_live, open('robots-staging2.txt') as robots_staging: diff = difflib.unified_diff( robots_live.readlines(), robots_staging.readlines(), fromfile='robots-live.txt', tofile='robots-staging.txt', )...