Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Python Tutorial: Data types and data merging

  • DataCamp
  • 2020-03-10
  • 312
Python Tutorial: Data types and data merging
pandasmarketingPythonTutorialDataCampPython
  • ok logo

Скачать Python Tutorial: Data types and data merging бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Python Tutorial: Data types and data merging или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Python Tutorial: Data types and data merging бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Python Tutorial: Data types and data merging

Want to learn more? Take the full course at https://learn.datacamp.com/courses/an... at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.

---
In this lesson, we will talk about various techniques to manipulate data using Pandas.

Each column in a pandas DataFrame has a specific data type. Some of the common data types are strings (which are represented as objects), numbers, boolean values (which are True/False) and dates.

You can use the dtype attribute if you are interested in knowing the data type of a single column.

To change the data type of a column, you can use the astype() method. For example, you saw on the earlier slide that the converted column is stored as an object. It contains True and False values, so it's more appropriate to store it as a boolean. You can use the astype() method along with the argument 'bool' as shown here to change its data type.

If you check the data type of the 'converted' column again, you will see that it's now 'bool'.

The marketing_channel column captures the channel a user saw a marketing asset on. Say you want to have a column that identifies if a particular marketing asset was a house ad or not.

You can use numpy's where() function to create a new boolean column to establish this. The first argument is an expression that checks whether the value in the marketing_channel column is 'House Ads', the second argument is the value you want to assign if the expression is true, and the third argument is the value you want to assign if the expression is false.

Due to the way pandas stores data, in a large dataset, it can be computationally inefficient to store columns of strings. In such cases, it can speed things up to instead store these values as numbers.

To create a column with channel codes, build a dictionary that maps the channels to numerical codes. Then, use the map() method on the channel column along with this dictionary, as shown here.

Often, you will have date columns that are improperly read as objects by pandas. However, as you will see in the following lessons, having date columns properly imported as the datetime datatype has several advantages.

You have two options to ensure that certain columns are treated as dates. First, when importing the dataset using the read_csv() function, you can pass a list of column names to the parse_dates argument to ensure that these columns are correctly interpreted as date columns.

Another option is to use the pandas' datetime() function to convert a specific column.

Once the dates in the column are properly imported, you can use various date attributes to extract relevant information.

For example, to obtain the day of the week, you can use the dayofweek attribute along with the dt accessor on the date column. This will result in a numerical value where 0 maps to Monday, 1 to Tuesday, and so on.

It's time for you to practice these concepts.

#PythonTutorial #pandas #marketing #DataCamp #Python

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]