This article will show you how to import CSV files from OneLake. For more information about importing CSV files using Pandas and working with different separators, date and numeric formats: Import Local CSV File into Pandas Dataframe.

Ok let’s dive into the steps:

Step 1: Get the file url by clicking on the 3 dots next to the file in the Lakehouse Explorer and choose “Copy ABFS path ” for an Absolute or “Copy File API Path” for a Relative path of the file. The Absolute Path can be usefull if you want to import files from an other Lakehouse than the one the Notebook is connected to.

Step 2: Call the read_csv() function passing in the Relative of Absolute fileurl:

import pandas as pd

df = pd.read_csv(fileUrl, encoding='utf-8',sep=',')