import

Import Data Into Python

0:00
↔️ ↕️

Timecodes:

Hey guys, in this video I want to go over kind of a beginner video on Python for

data science and in particular I want to go over how you can import a text file

that has a data set into Python. So it's basically going to be how you can import

data into a Python script and in particular in this video we're going to

use a Python library called pandas, which is basically the most common Python

library that you use in order to import data into Python.

Since pandas is a Python library, you have to have it installed on your local

version of Python. In my case, I already do have that Python library

installed already but if you don't, you want to open up a terminal window and

run "pip install pandas." If I run that, I already have it installed so it's not

really going to do anything. It's just going to say "Requirement already satisfied"

but basically for my computer setup: I'm running Python 3.8 and I already have

pandas the Python library installed. So we're going to use that Python library

to import text files or dot CSV files into Python and I have this Python

script open in VS Code. This is just a short script that has two different

examples for how you can import data. Let's go ahead and go over this script.

For importing data, I'm going to assume that you have some dot CSV file or dot

txt file or dot dat file on your computer that you want to import. You can

also import a URL and I'll get to that in the second example but for running a

Python script, you basically always want to create a directory for your Python

script and so I on my local computer have a folder called import underscore


Related queries:


how to import data in python jupyter notebook
how to import data in python from excel
how to import data in python from csv
how to import data in python code
how to import database in python
how to import json data in python
how to import data frame in python
how to import text data in python
how to import image data in python