Python Pandas Tutorial 2: Dataframe Basics




[ad_1]

This pandas tutorial covers basics on dataframe. DataFrame is a main object of pandas. It is used to represent tabular data (with rows and columns). This tutorial will go over,
1) What is dataframe?
2) Create dataframe from csv file and python dictionary
3) Dealing with rows and columns
4) Operations: mean, max, std, describe
5) Conditional selection
6) set_index function and usefulness of it

Topics that are covered in this Python Pandas Video:
0:00 Introduction
0:15 What is Dataframe?
2:02 Import pandas in jupyternotebook
3:34 Create dataframeusing python dictionary
5:15 Use head() method
5:52 Use tail() method
6:10 Use Indexing and slicing in dataframe
8:12 Insert new cell in current cell
8:39 What is the type of your dataframe?
10:01 Operations with your dataframe
10:34 Use max() method
11:02 Use mean() method
11:11 Use min() method
11:23 Use describe() method
12:12 Conditional select the data in your dataframe
14:55 Pandas operations list
15:41 Use set_index() method
18:12 Use reset_index() method

Code: https://github.com/codebasics/py/tree/master/pandas/2_dataframe_basics

Next Video:
Python Pandas Tutorial 3: Different Ways Of Creating DataFrame
https://www.youtube.com/watch?v=3k0HbcUGErE&list=PLeo1K3hjS3uuASpe-1LjfG5f14Bnozjwy&index=3

Very Simple Explanation Of Neural Network: https://www.youtube.com/watch?v=ER2It2mIagI

Popular Playlist:
Complete python course: https://www.youtube.com/playlist?list=PLeo1K3hjS3uv5U-Lmlnucd7gqF-3ehIh0

Data science course: https://www.youtube.com/playlist?list=PLeo1K3hjS3us_ELKYSj_Fth2tIEkdKXvV

Machine learning tutorials: https://www.youtube.com/playlist?list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw

Pandas tutorials: https://www.youtube.com/playlist?list=PLeo1K3hjS3uuASpe-1LjfG5f14Bnozjwy

Git github tutorials: https://www.youtube.com/playlist?list=PLeo1K3hjS3usJuxZZUBdjAcilgfQHkRzW

Matplotlib course: https://www.youtube.com/playlist?list=PLeo1K3hjS3uu4Lr8_kro2AqaO6CFYgKOl

Data structures course: https://www.youtube.com/playlist?list=PLeo1K3hjS3uu_n_a__MI_KktGTLYopZ12

Data Science Project – Real Estate Price Prediction: https://www.youtube.com/watch?v=rdfbcdP75KI&list=PLeo1K3hjS3uu7clOTtwsp94PcHbzqpAdg

To download csv and code for all tutorials: go to https://github.com/codebasics/py, click on a green button to clone or download the entire repository and then go to relevant folder to get access to that specific file.

Website: http://codebasicshub.com/
Facebook: https://www.facebook.com/codebasicshub
Twitter: https://twitter.com/codebasicshub

Source


[ad_2]

Comment List

  • codebasics
    November 15, 2020

    Step by step roadmap to learn data science in 6 months: https://www.youtube.com/watch?v=H4YcqULY1-Q
    How to learn coding for beginners | Learn coding for free: https://www.youtube.com/watch?v=CptrlyD0LJ8

  • codebasics
    November 15, 2020

    Thank you!

  • codebasics
    November 15, 2020

    df.loc['1/3/2017'] is not working for the date. Rest all fields are working properly with df.loc. but date returns an error again and again. Can someone please help

  • codebasics
    November 15, 2020

    If the csv file isn't in the jupyter notebook, what do I do?

  • codebasics
    November 15, 2020

    Thanks for video

  • codebasics
    November 15, 2020

    Commentaires

  • codebasics
    November 15, 2020

    This is amazing! Thank you!

  • codebasics
    November 15, 2020

    Thank you

  • codebasics
    November 15, 2020

    Excellent – so well presented with great ecplanations. I have looked at a lot of Pandas tutorials and these are the best I have come across. Very clear explanations and you can tell the presenter has a very good understanding of the subject. Something many others don't have. Will be checking out some of his other videos. 👍

  • codebasics
    November 15, 2020

    First video that got straight to the point

  • codebasics
    November 15, 2020

    You are very excellent

  • codebasics
    November 15, 2020

    Tq but one doubt it's showing attribute error

  • codebasics
    November 15, 2020

    thank you for this presentation

  • codebasics
    November 15, 2020

    The explanation goes smoothly into the brain, if u listen carefully

  • codebasics
    November 15, 2020

    Thanks bro for teaching me dataframe

  • codebasics
    November 15, 2020

    But I don’t have excel how can I import?

  • codebasics
    November 15, 2020

    Sir u r a genius 🤩🤩
    Ur lectures were really easy to understand even for a utter beginner like me 👍😃
    Love ❤️ from Tamilnaadu south of India 🇮🇳

  • codebasics
    November 15, 2020

    import pandas as pd

    import numpy as np

    import matplotlib.pyplot as plt

    import seaborn as sns

    subset={ 'idno' : [1023, 1049, 1219, 1246, 1078, 1221 ],

    'name' : ['David','Amelia','Alan','Ram','Ashley','Jim' ],

    'team' : ['red','yellow','red','yellow','red',' yellow'],

    'strwgt': [189, 145, 192, 194, 127, 220 ],

    'endwgt': [165, 124, 192, 177, 118 , 184 ] }

    print(subset)

    print()

    print('CREATE ABOVE SUBSET AS A DATAFRAME' )

    print()

    df=pd.DataFrame(subset)

    print(df)

    user =input('Enter value:')

    for i in user:

    print(i)

    what is the error in above code i want retrive data as per user input please tell me

  • codebasics
    November 15, 2020

    too slow at normal speed, watch it at 1.25x or 1.5x. and yes this guy is Amazing.

  • codebasics
    November 15, 2020

    Thank you so much for this video. It has helped me a lot in understanding dataframes.

  • codebasics
    November 15, 2020

    import pandas as pd
    my_df=pd.DataFrame(Data=[4,5,6,7], index=range(0,4), columns=['A'])

    print(pd.DataFrame(my_df))

    TypeError: __init__() got an unexpected keyword argument 'Data'

    it shows like this please help me sir. Why dataframe as error ? 🙁

  • codebasics
    November 15, 2020

    Highly recommended to those who are searching for the perfect tutorial on Pandas! He literally reads a learners mind!

  • codebasics
    November 15, 2020

    Filter can be done in SQL, why need pandas

  • codebasics
    November 15, 2020

    NOTbook

  • codebasics
    November 15, 2020

    thank you

  • codebasics
    November 15, 2020

    Sir i am getting this error. I have already tried a lot methods to fix this problem but none of them are working. please help me to fix this.

    import pandas as pd
    import os

    df = pd.read_csv(r"H:pandas codingweather_data.csv")

    ParserError Traceback (most recent call last)
    <ipython-input-14-e0b768ad58ba> in <module>
    —-> 1 df = pd.read_csv(r"H:pandas codingweather_data.csv")

    ~anaconda3libsite-packagespandasioparsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision)
    674 )
    675
    –> 676 return _read(filepath_or_buffer, kwds)
    677
    678 parser_f._name_ = name

    ~anaconda3libsite-packagespandasioparsers.py in _read(filepath_or_buffer, kwds)
    452
    453 try:
    –> 454 data = parser.read(nrows)
    455 finally:
    456 parser.close()

    ~anaconda3libsite-packagespandasioparsers.py in read(self, nrows)
    1131 def read(self, nrows=None):
    1132 nrows = _validate_integer("nrows", nrows)
    -> 1133 ret = self._engine.read(nrows)
    1134
    1135 # May alter columns / col_dict

    ~anaconda3libsite-packagespandasioparsers.py in read(self, nrows)
    2035 def read(self, nrows=None):
    2036 try:
    -> 2037 data = self._reader.read(nrows)
    2038 except StopIteration:
    2039 if self._first_chunk:

    pandas_libsparsers.pyx in pandas._libs.parsers.TextReader.read()

    pandas_libsparsers.pyx in pandas._libs.parsers.TextReader._read_low_memory()

    pandas_libsparsers.pyx in pandas._libs.parsers.TextReader._read_rows()

    pandas_libsparsers.pyx in pandas._libs.parsers.TextReader._tokenize_rows()

    pandas_libsparsers.pyx in pandas._libs.parsers.raise_parser_error()

    ParserError: Error tokenizing data. C error: Expected 1 fields in line 4, saw 3

  • codebasics
    November 15, 2020

    is there anyone else who's hearing the sound only in left ear??

  • codebasics
    November 15, 2020

    Thank you Sir. My csv dataset has a lot of texts explaining the data in the first 20 rows. The dataset also has many columns. My aim is to select only from row 50 and after, and so to select few columns. How should I do that?

  • codebasics
    November 15, 2020

    Thanks man

  • codebasics
    November 15, 2020

    df.head() gives initial first 5 rows and df.tail() gives last 5 rows

  • codebasics
    November 15, 2020

    Sir I get an error like module not found??

Write a comment