Python Pandas Tutorial 3: Different Ways Of Creating DataFrame

Python Pandas Tutorial 3: Different Ways Of Creating DataFrame

codebasics

7 лет назад

333,084 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

rayoh2011
rayoh2011 - 23.10.2023 00:34

It's now October 2023. For people using the newer versions of Pandas, you need to upgrade the Excel reading module.
Short story: XLRD is the default engine for Pandas to read Excel files, and as it happens XLRD stopped supporting XLSX files.
If you want to read one anyway, you need to pip install openpyxl, and set it to be the reading engine instead of the default.

Ответить
Pintu Kumar
Pintu Kumar - 18.08.2023 16:08

Sir how to save our file in jupyter notebook anaconda plz sir maake a video

Ответить
ujjwal chetan
ujjwal chetan - 03.05.2023 16:52

Very methodical approach to teaching. Great. Thanks👍

Ответить
Learner 🦄
Learner 🦄 - 24.08.2022 10:51

Very much good 👍

Ответить
CHARMEE VAGHELA
CHARMEE VAGHELA - 30.06.2022 14:51

Sir i am not able to use read_excel() it is throwing errors like module not found
i have imported pandas as pd and done the same as you taught, can you please tell the solution ?

Ответить
Chirag Rathod
Chirag Rathod - 07.06.2022 15:20

Sir I'm not able to import excel and CSV. file the way you telling.i'm getting error like unicode error codec can't decode bytes in postinton 2-3: truncated\uxxxx escape.I have installed pandas
I have searched this error in Gogle and I got a solution such as use duplicate backlash , forwardlash and r" " still it's same error poping up
What's mistake have I been doing sir here

Ответить
taha mhiri
taha mhiri - 04.03.2022 01:45

great work !

Ответить
Jessi Pinkman
Jessi Pinkman - 08.02.2022 23:59

Super !

Ответить
satish kumar
satish kumar - 04.12.2021 17:29

Hi Sir, can you help me to read multiple parquet files from different directories using python

Ответить
vivek yadav
vivek yadav - 19.09.2021 06:35

I think before importing excel in pandas one should install, xlrd using pip or conda

Ответить
Abhijeet Singh
Abhijeet Singh - 13.09.2021 11:18

what happens in the last one? how the system is interpreting that dates and events etc are column headings and need to be placed at the top only

Ответить
Motion graphic
Motion graphic - 10.09.2021 01:21

I have problem with csv file. I kept getting the same error over and over again. The pandas has no attributes called csv . Any one help

Ответить
Rajeendra Perera
Rajeendra Perera - 17.05.2021 08:01

in example 3 the following error message is displayed. Name Error: pd is not defined.

Ответить
Alex Kelso
Alex Kelso - 16.03.2021 05:08

legend. this is amazing. Thanks for sharing!

Ответить
Shoaib Rahman
Shoaib Rahman - 26.12.2020 22:40

Man! Best tute I've ever seen on pandas. Lovely

Ответить
Kevin Tempel
Kevin Tempel - 21.12.2020 08:36

Thank you!

Ответить
Ingenious Robotics
Ingenious Robotics - 10.09.2020 15:37

Hello, what does the r before C: ?
df = pd.csv_read(r 'C:\datasets\example.csv')
With some letters of the lowercase alphabet from error if there is not.
thx
ric

Ответить
DIPANNITA
DIPANNITA - 29.08.2020 16:45

Awesome information ❤️

Ответить
Yügêßh
Yügêßh - 13.05.2020 16:50

Sir i want the answer for
Write the syntax of dataframe method?

Ответить
Asel Toktokozhoeva
Asel Toktokozhoeva - 08.05.2020 10:53

thank you!!

Ответить
lamalem
lamalem - 21.04.2020 22:38

Simple ! And easy

Ответить
Mahesh Palaskar
Mahesh Palaskar - 20.04.2020 08:19

Thanks man such a great vedio

Ответить
aniruddha deshmukh
aniruddha deshmukh - 29.03.2020 16:34

Sir I have one error, dataframe object has not attribute dataframe

Ответить
Komal Patil
Komal Patil - 23.03.2020 16:04

i am not able to open the csv file it is giving me error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xae in position 16: invalid start byte
Give me solution

Ответить
Syed Hassan
Syed Hassan - 09.03.2020 22:33

Boss, I am using the same Jupyter notebook, but I could'nt see border lines in df across rows and columns, could you please help in this.

Ответить
Cute Baby530
Cute Baby530 - 30.12.2019 16:12

Thanks sir
There tutorials are really helpful

Ответить
PrinuTriesHerBest
PrinuTriesHerBest - 09.12.2019 06:53

👍

Ответить
Dan Cyclist
Dan Cyclist - 02.11.2019 22:55

Simple and efficient ... Thank you

Ответить
Joseph Pravin
Joseph Pravin - 15.09.2019 09:25

do we need "pip install xlrd" for read_csv?

Ответить
SABARISH KAVALA
SABARISH KAVALA - 12.06.2019 11:07

Thank you for teaching me Basics of Pandas..

Ответить
Ujwala
Ujwala - 30.05.2019 07:52

How to add return value from function to dataframe column?

Ответить
Skk Kks
Skk Kks - 26.05.2019 21:33

Thank you for making the concept so easy and simple .I am worried about the people why gave "thumbs down" wishing if they know better let us know with the proof of video tutorials--------you thumbs downer----

Ответить
Naman Singhal
Naman Singhal - 09.04.2019 08:35

install xlrd if unable to read excel file

Ответить
Shashank Jain
Shashank Jain - 04.03.2019 18:08

Nice and well-explained videos.

Ответить
Nick T
Nick T - 02.02.2019 03:30

This should save you some time! Here is the text he copied and pasted for examples 3 through 5

# way 3 (python dictionary)
weather_data = {
'day': ['1/1/2017', '1/2/2017', '1/3/2017'],
'temperature': [32, 35, 28],
'windspeed': [6,7,2],
'event': ['Rain', 'Sunny', 'Snow']
}


# way 4 (python tuple list)
weather_data = [
('1/1/2017', 32, 6, 'Rain'),
('1/2/2017', 35, 7, 'Sunny'),
('1/3/2017', 28, 2, 'Snow')
]

# way 5 (python dictionary list)
weather_data = [
{'day': '1/1/2017', 'temperature': 32, 'windspeed': 6, 'event': 'Rain'},
{'day': '1/2/2017', 'temperature': 35, 'windspeed': 7, 'event': 'Sunny'},
{'day': '1/3/2017', 'temperature': 28, 'windspeed': 2, 'event': 'Snow'}
]

Ответить
Arun Pani
Arun Pani - 19.01.2019 21:54

Whoever is unable to read csv/xlsx, please ensure you have Anaconda installed.

After Anaconda installation,
Search for Jupyter in Windows and press Enter.
Perform a Ctrl-c and it should guide you through.

Any more questions, please let me know :) Glad to help !!!

Ответить
Md. Shafiqul Islam
Md. Shafiqul Islam - 09.01.2019 10:11

nice tutorial

Ответить
Jay Rollo
Jay Rollo - 04.01.2019 20:50

Man you are awesome.

Ответить
OpenAi
OpenAi - 26.12.2018 16:37

I have a worksheet (sample) as follows.

df.head()

uniname 19.1 19.2 19.3 19.4
0 uni1 Complied NotAppl Clarification NotAppl
1 uni2 NotAppl Complied NotComplied Clarification
2 uni3 Clarification NotComplied Complied Complied
3 uni4 Complied Clarification NotAppl Complied

df.dtypes()
uniname object
19.1 object
19.2 object
19.3 object
19.4 object
dtype: object

Objective here is
To count each university having count of having each status for each article (19.1,19.2 etc).

e.g output.
Uniname | Article | Status | Count
uni1 - | 19.1 - | Complied - | 2
| 19.1 - | NotAppl - | 1
| 19.1 - | Clarification - | 1

| 19.2 | NotAppl | 1
| 19.2 | Complied | 1
|19.2 | NotComplied | 1
| 19.2 |Clarification|

uni2.........

uni3.........

uni3 .......

I have used nested loops and with functions such as iterrows() and iteritems() for dataframe, however not able to crack it. Can you help?

Ответить
praveen khanna
praveen khanna - 08.12.2018 10:13

WHAT IS THE DIFFERENCE BETWEEN XLS FILE AND CSV FILE BOTH LOOKS SIMILAR

Ответить
Raj Iyengar
Raj Iyengar - 23.11.2018 22:49

Great Tutorial. Can you list some tips if we need to productionalize this using Cloud environment - AWS/GCP/Azure? Thanks.

Ответить
Deb K
Deb K - 15.10.2018 22:29

great work man !

Ответить
Samujjal Choudhury
Samujjal Choudhury - 30.09.2018 17:29

sir i m getting an error in read the csv file as UnicodeDecodeError ....
anyone please help

Ответить
Rajesh K
Rajesh K - 15.09.2018 18:29

This is a gr8 tutorial, i have one question , can we apply theses datafrmaes in spark ?

Ответить
Mahdi Kotti
Mahdi Kotti - 14.09.2018 04:02

man your work quality is priceless !! short , very useful , with examples and informative videos !! the best way to learn python for data science !! keep up the good work and thanks a lot

Ответить
Amit
Amit - 01.09.2018 11:07

from sql file?

Ответить
Vinod Kinoni
Vinod Kinoni - 14.07.2018 19:00

a great work

Ответить