RUVIDEO
Поделитесь видео 🙏

Python Tutorial: How to use dates & times with pandas смотреть онлайн

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

---
In this chapter you will learn about using dates with python pandas. Pandas was developed to analyze financial data that often come as time series, and has powerful functionality to make your life easier

The key to this are data types tailored to managing date and time information. These data types represent either points in time, or periods of time. They have attributes and methods that allow you to access and manipulate the time dimension of your data. Any column can contain date or time information, but it is most important as a DataFrame index, because this converts the entire DataFrame into a time series. You will also learn to use many DataFrame methods that leverage date information stored in the index.

Let's first take a look at these data types. Using the pandas library and python's builtin datetime class, you can create a pandas Timestamp. You can also use a date string instead of a datetime object, both produce the same result. If you display the timestamp, you'll notice that the time has been automatically set to midnight.

The pandas TimeStamp has attributes so you can access various time aspects of your data. You can, for instance, retrieve the year or the name of the weekday. pandas also has a data type for time periods.

The period object always has a frequency, with months as the default. It also has a method to convert between frequencies, for instance from monthly to daily frequency. You can convert a period to a timestamp object, and a timestamp back to a period object. You can also do basic date arithmetic.

Starting with a period object for January 2017 at monthly frequency, just add the number 2 to get a monthly period for March 2017. Time stamps can also have frequency information. If you create the timestamp for Jan 31 2017 with monthly frequency and add 1, you get a timestamp for February 28th. To create a time series,

you need a sequence of dates. To create a sequence of Timestamps, use the pandas function date_range. You need to specify a start date, and either and end date, or a number of periods. The default is daily frequency. The function returns the sequence of dates as a DateTimeindex with frequency information. You will recognize the first element as a pandas Timestamp.

You can convert the index to a PeriodIndex, just like you could Timestamps to Period objects. Now you can create a time series by setting the DateTimeIndex as the index of your DataFrame.

DataFrame columns containing dates will be assigned the datetime64 data type, where 'ns' means nanoseconds.

Let's create 12 rows with two columns of random data to match the DateTimeindex. Provide the dates to the DataFrame constructor, and you have created your first time series with 12 monthly timestamps. Pandas allows you to create and convert between many different frequencies.

Here are the most important ones. Some may also be set to the beginning or end of the period, or use business instead of calendar periods. There are also numerous Timestamp attributes.

Let's now practice your new time series skills!


#DataCamp #PythonTutorial #Manipulating #TimeSeries #Data #Python

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Tutorial: How to use dates & times with pandas» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.