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
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'}
]
this is so far the best video for self-learning Python/Pandas ... thank you so much!
I agree with so many others here....your videos are truly top notch.
Man! Best tute I've ever seen on pandas. Lovely
You made best tutorials!
Great Pandas Tutorial
I got just impressed during first time watching your videos... but second time, I feel it's great!!!!
great work man !
Nice and well-explained videos.
Great tutoriel!!!
Very methodical approach to teaching. Great. Thanks👍
Amazing videos. Thanks a ton.
soo helpful, thanks for this video .
Simple ! And easy
great work !
Man you are awesome.
A great tutorial...
Thanks man such a great vedio
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-----
Thank you!
Very much good 👍
a great work
thank you!!
i will come back tommorow nice video ❤
nice tutorial
Super !
Great Tutorial. Can you list some tips if we need to productionalize this using Cloud environment - AWS/GCP/Azure? Thanks.
This is a gr8 tutorial, i have one question , can we apply theses datafrmaes in spark ?
Excellent. I am not able to use read _excel() and it throws errors. I installed xlrd as per the error message, However no go
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
*I think before importing excel in pandas one should install, xlrd using pip or conda*
Sir i want the answer for
Write the syntax of dataframe method?
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.
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
Hi Sir, can you help me to read multiple parquet files from different directories using python
It's great tutorial.I have a question when I am using a large excel file all data is not displayed in jupyter notebook.How to make all data display. I have file wioth 200+ rows and 16 columns.In between it will show break with ........ for two lines and continues
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
chaange the second parameter according to your dataset
WHAT IS THE DIFFERENCE BETWEEN XLS FILE AND CSV FILE BOTH LOOKS SIMILAR
Ways of creating data frames
1. read_csv()
2. read_excel(location , "Sheet1")
3. as dictionary ( 3:26)
4. as tuple ( list of tuples ) Each element in a list is tuple ( 4:20)
5 . list of dictionaries (6:25)
in example 3 the following error message is displayed. Name Error: pd is not defined.
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 ?
AttributeError: module 'pandas' has no attribute 'read_excel'
from sql file?
do we need "pip install xlrd" for read_csv?
you don't need to install anything extra as long as you have done pip install pandas or installed anaconda.
at 5:19 there are only 3 data points in tuple still you mentioned 4 columns and it worked why
👍
Sir I have one error, dataframe object has not attribute dataframe
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
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.
That's because you are using old version of notebook. Download latest version of anaconda and install it
df=pd.read_excel("file.xlsx", "Sheet1")
its not working its giving error with comma, and if i am trying sheet_name = "Sheet1" its showing sheet not found
what to do?
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
Sir how to save our file in jupyter notebook anaconda plz sir maake a video
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
Refer
www.edureka.co/community/51644/python-unicodedecodeerror-codec-decode-position-invalid
sir i m getting an error in read the csv file as UnicodeDecodeError ....
anyone please help
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?
Got some further code to slice and dice into dataframe and reached to following level.
Step 1: Three loops and three different lists to store values for each column.
Step2: covered them into dataframes and index them
dfunin = pd.DataFrame(unin)
dfarti= pd.DataFrame(arti)
dfstat = pd.DataFrame(stat)
dfunin.set_index(0,inplace=True)
dfarti.set_index(0,inplace=True)
dfstat.set_index(0,inplace=True)
Step3: Creating a Dictionary and storing the value for each
newdict = {"aUniname":'',
"bArticle":'',
"cStatus": ''}
for i,r in dfunin.iterrows():
#print("University -->" , r[i])
newdict['aUniname']= r[i] - # Getting error "KeyError : 1"
for i1,r1 in dfarti.iterrows():
print("Article -->" , r1[i1])
#newdict['bArticle']= r1[i1]
for i2,r2 in dfstat.iterrows():
print("Status -->" , r2[i1])
#newdict['cStatus']= r2[i2]
Query at this stage: Getting an Keyvalue error while assigning value to dictionary
KeyError Traceback (most recent call last)
in ()
12
13 for i1,r1 in dfarti.iterrows():
---> 14 print("Article -->" , r1[i1])
15 #newdict['bArticle']= r1[i1]
16
Can you guide at this stage?
Step by step roadmap to learn data science in 6 months: th-cam.com/video/H4YcqULY1-Q/w-d-xo.html
Machine learning tutorials with exercises:
th-cam.com/video/gmvvaobm7eQ/w-d-xo.html
Learning From 7 year old tutorials🥲
Thank you!
Do you want to learn python from me with a lot of interactive quizzes, and exercises? Here is my project-based python learning course: codebasics.io/courses/python-for-beginner-and-intermediate-learners