Introduction to pandas Library in Python (Tutorial & Examples) | DataFrame Manipulation & Analysis

preview_player
Показать описание
Python code of this video:

import pandas as pd # Import pandas library to Python

data1 = pd.DataFrame() # Create empty DataFrame
print(data1) # Print empty DataFrame

data2 = pd.DataFrame({'x1':[5, 1, 2, 7, 5, 4], # Create pandas DataFrame with values
'x2':range(1, 7),
'x3':['a', 'b', 'a', 'c', 'b', 'c']})
print(data2) # Print pandas DataFrame

print(data3) # Print new pandas DataFrame

data4 = data2[['x1', 'x2']] # Subset columns of pandas DataFrame
print(data4) # Print new pandas DataFrame

new_col = [9, 99, 999, 99, 9, 999] # Create list
print(new_col) # Print list

print(data5) # Print new pandas DataFrame

data6['new_col'] = data6['new_col'].astype(str) # Convert column to string
print(data6) # Print new pandas DataFrame

data7 = pd.DataFrame({'ID':range(1001, 1007), # Create first pandas DataFrame with ID
'x1':[5, 1, 2, 7, 5, 4],
'x2':range(1, 7),
'x3':['a', 'b', 'a', 'c', 'b', 'c']})
print(data7) # Print pandas DataFrame

data8 = pd.DataFrame({'ID':range(1004, 1011), # Create second pandas DataFrame with ID
'y1':range(10, 3, - 1),
'y2':['x', 'y', 'y', 'x', 'x', 'y', 'x']})
print(data8) # Print pandas DataFrame

data8,
on = 'ID')
print(data9) # Print merged pandas DataFrame

data8,
on = 'ID',
how = 'outer')
print(data10) # Print merged pandas DataFrame

print(data11) # Print updated pandas DataFrame

data12 = data12[data12.x1 != 5] # Drop by logical condition
print(data12) # Print updated pandas DataFrame

Table of Contents:
00:00 - Introduction
01:10 - Data Manipulation
18:10 - Data Analysis
21:26 - Data Visualization
24:02 - Data Export & Import

Follow me on Social Media:

Рекомендации по теме
Комментарии
Автор

Amaaaazing work! So glad to hear about the new Python series 🥰

rebecab.
Автор

I just decided to start learning Pandas and this was the first video I tried. What a great introduction! Fantastisch! Sehr Danke!

dougmartin
Автор

great video it really cleared a few things up. Do you mind if i ask how you set up your workspace in VSCode?

funkmonkey
Автор

Hey Joachim..! I really appreciate your videos on R and now in Python. I’m a statistics student so i want to learn statistical methods in python. Thank you in advance.

dhwanimaster
Автор

I am a novice when it comes to Python. Pandas can be likened to the dplyr package in R?

jamesleleji
Автор

hi, , , r u going to create videos for other python libraries also (like numpy or matplatlob or seaborn..)...

shivamshinde
Автор

Hi Joachim. Kann you make a video please, where you explain how to install and make ready to work python? There are so many different python aplications over there, that I don´t know whrere to start. Thank you very much

danmentorium