Код: Выделить всё
data = pd.read_csv('Weather_not_tidy.csv')
data = data.rename(columns={'Temp2009': '2009', 'Temp2010': '2010'})
tidyData = pd.melt(data2, value_vars=['2009', "2010"], id_vars=['month', 'day', 'hour_of_day'],
var_name='year', value_name='temperature')
tidyData
month day hour_of_day year temperature
0 Jan 1 12 2009 -0.9
1 Jan 2 12 2009 -2.2
2 Jan 3 12 2009 4.2
3 Jan 4 12 2009 -4.7
4 Jan 5 12 2009 -7.8
... ... ... ... ... ...
725 Dec 27 12 2010 -6.8
726 Dec 28 12 2010 -11.0
727 Dec 29 12 2010 -10.6
728 Dec 30 12 2010 -3.0
729 Dec 31 12 2010 -2.7
730 rows × 5 columns
plot = (
ggplot(tidyData, aes(x='temperature', fill='year'))
+ geom_histogram(data=tidyData.loc[tidyData['year']=='2009'], alpha=0.6, bins=10)
)
plot
Код: Выделить всё
AttributeError: 'identity_trans' object has no attribute 'dataspace_is_numerical'Я использую vscode в Ubuntu, Python 3.11.10 и использую среду conda с следующие зависимости:
Код: Выделить всё
name: MVE080
dependencies:
- python=3.11
- plotnine=0.12
- numpy=1.26
- pandas=2.1
- pip=23.1
- pip:
- geopandas
Подробнее здесь: https://stackoverflow.com/questions/791 ... -numerical
Мобильная версия