<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:atom="http://www.w3.org/2005/Atom">

<channel>

<title>Yuriy Gavrilov: posts tagged Python</title>
<link>https://gavrilov.info/tags/python/</link>
<description>Welcome to my personal place for love, peace and happiness 🤖 Yuiry Gavrilov</description>
<author></author>
<language>en</language>
<generator>Aegea 11.4 (v4171e)</generator>

<itunes:owner>
<itunes:name></itunes:name>
<itunes:email>yvgavrilov@gmail.com</itunes:email>
</itunes:owner>
<itunes:subtitle>Welcome to my personal place for love, peace and happiness 🤖 Yuiry Gavrilov</itunes:subtitle>
<itunes:image href="https://gavrilov.info/pictures/userpic/userpic-square@2x.jpg?1643451008" />
<itunes:explicit>no</itunes:explicit>

<item>
<title>Как сделать scatter plot и посчитать В какой стране есть Интернет стоимостью почти 800 за Гб</title>
<guid isPermaLink="false">81</guid>
<link>https://gavrilov.info/all/kak-sdelat-scatter-plot-i-poschitat-v-kakoy-strane-est-internet/</link>
<pubDate>Sun, 12 Nov 2023 23:10:06 +0300</pubDate>
<author></author>
<comments>https://gavrilov.info/all/kak-sdelat-scatter-plot-i-poschitat-v-kakoy-strane-est-internet/</comments>
<description>
&lt;p&gt;Все вроде не сложно, но вот наименование точек оказалось самым сложным)&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('https://a.gavrilov.info/data/python/file.csv')
df.iloc[:, 6] = df.iloc[:, 6].str.replace('$','',regex=True)
df.iloc[:, 5] = df.iloc[:, 5].str.replace('$','',regex=True)
df.iloc[:, 5] = df.iloc[:, 5].astype(float)
df.iloc[:, 6] = df.iloc[:, 6].astype(float)
fig, ax = plt.subplots(figsize=(10, 6))
ax.scatter(x = df[&amp;quot;Cheapest 1GB for 30 days (USD)&amp;quot;], y = df[&amp;quot;Most expensive 1GB (USD)&amp;quot;])
for idx, row in df.iterrows():
 ax.annotate(row['Name'], (row['Cheapest 1GB for 30 days (USD)'], row['Most expensive 1GB (USD)']))
plt.show()&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Это одно из заданий, которые встречаются на курсах по питону.&lt;/p&gt;
&lt;p&gt;Файл данных тут: &lt;a href="https://a.gavrilov.info/data/python/file.csv,"&gt;https://a.gavrilov.info/data/python/file.csv,&lt;/a&gt; это затраты на интернет в разных странах.&lt;/p&gt;
&lt;p&gt;А задание само такое: “Построим: диаграмму рассеяния по столбцам таблицы ‘Cheapest 1GB for 30 days (USD)’ и ‘Most Expensive 1GB (USD)’. В какой стране есть Интеренет стоимостью почти 800 за Гб, если верить таблице?”&lt;/p&gt;
</description>
</item>

<item>
<title>Рисую простую диаграмму на Python</title>
<guid isPermaLink="false">25</guid>
<link>https://gavrilov.info/all/risuyu-prostuyu-diagrammu-na-python/</link>
<pubDate>Sat, 09 Jul 2022 19:36:03 +0300</pubDate>
<author></author>
<comments>https://gavrilov.info/all/risuyu-prostuyu-diagrammu-na-python/</comments>
<description>
&lt;p&gt;Вот собственно сам код:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;import pandas as pd
import altair as alt

df = pd.read_excel('Sample - Superstore.xls', index_col=0) 
df2 = df.groupby('Region').sum()
df2 = df2.reset_index(level=0)

bars = alt.Chart(df2).mark_bar().encode(
   alt.X('Region:N', sort='-y'),
   alt.Y('Sales:Q'),
   color=alt.condition(  alt.datum.Region == 'West',  # If the year is 1810 this test returns True,
   alt.value('orange'),     # which sets the bar orange.
   alt.value('steelblue'))   
)

text = bars.mark_text(
    align='left',
    baseline='middle',
    dx=11  # Nudges text to right so it doesn't appear on top of the bar
).encode(
    text='mean(Sales):Q'
)

(bars + text).properties(height=300)&lt;/code&gt;&lt;/pre&gt;&lt;div class="e2-text-picture"&gt;
&lt;img src="https://gavrilov.info/pictures/visualization.png" width="209" height="370" alt="" /&gt;
&lt;/div&gt;
</description>
</item>


</channel>
</rss>