Posts

Showing posts from February, 2020

Mastering String Methods in Pandas

Image
Pandas is a popular python library that enables easy to use data structures and data analysis tools. Pandas can be used for reading in data, generating statistics, aggregating, feature engineering for machine learning and much more. The Pandas library also provides a suite of tools for string/text manipulation. In this post, we will walk through some of the most important string manipulation methods provided by pandas. Let’s get started! First, let’s import the Pandas library import pandas as pd Now, let’s define an example pandas series containing strings: s = pd.Series(['python is awesome', 'java is just ok', 'c++ is overrated']) Let’s print this series: print(s) We notice that the series has ‘dtype: object’, which is the default type automatically inferred. In general, it is better to have a dedicated type. Since the release of Pandas 1.0, we are now able to specify dedicated types. Make sure Pandas is updated by executing the followi

Announcing Oracle Cloud Shell

Image
I’m excited to announce the release of Cloud Shell for Oracle Cloud Infrastructure! Cloud Shell gives you access to an always available Linux shell directly in the Oracle Cloud Infrastructure Console. You can use the shell to interact with resources, follow labs and tutorials, and quickly run  OCI CLI  commands. Cloud Shell joins the existing the suite of  developer tools  (CLI, SDKs, and APIs) as a way to help you manage your Oracle Cloud Infrastructure resources. And, it’s now available in all  commercial regions . Cloud Shell is free to use (with  monthly limits on usage ) and easy to access from the Console. You don't need to set up any resources to get started with Cloud Shell; just click the new icon at the top of the Console. Cloud Shell offers the following features: A pre-authenticated OCI CLI, so no set up is required to start using the CLI in Cloud Shell A full Linux shell, with  key developer tools  for interacting with Oracle Cloud Infrastructure services,

How to Delete Millions of Rows Fast with SQL

Image
t's a rare event. Removing data from a table. But every now and then you may need to do a bit of spring cleaning and clear down data. This is easy to do with  delete . But this presents a problem. Deleting lots of rows can be slow. And there's a chance it'll take even longer because another session has locked the data you want to remove. Luckily there's a trick to speed up the process: Turn the DML into DDL! In this post we'll start with a quick recap of  how delete works . Then look at several alternatives you can use in Oracle Database to remove rows faster: Removing all the rows fast with  truncate Using  create-table-as-select  to wipe a large fraction of the data Dropping or truncating partitions Using a filtered table move If you want to see which is quickest, you can  skip straight to the performance comparison . How to Delete Rows with SQL Removing rows is easy. Use a  delete  statement. This lists the table you want to remove ro