I cannot plot data using python. Seems like a localisation problem, comma is used instead of full stop as a decimal separator in a matplotlib function. Feedback Type: Frown (Error) Timestamp: ...
htp84
8 years agoRegular Visitor
I cannot share my original data but I have (almost) succeded to reproduce the error using the train dataset of this kaggle competition: https://www.kaggle.com/c/house-prices-advanced-regression-techniques
I get a similar error as my original post. Below is the code I used and the error message:
import pandas as pd import matplotlib.pyplot as plt dataset.YrSold = dataset.YrSold.astype(str) dfPerYear = dataset.groupby(by="YrSold").sum().reset_index() dfPerYear.plot(x="YrSold", y="SalePrice", kind="line") plt.show()
Feedback Type:
Frown (Error)
Timestamp:
2018-08-14T14:18:32.0135794Z
Local Time:
2018-08-14T16:18:32.0135794+02:00
Session ID:
f8f0d719-3bfb-431b-9739-5eb73403e26b
Release:
August 2018
Product Version:
2.61.5192.541 (18.08) (x64)
Error Message:
Рŷτђσñ ŝςѓϊрţ єŗŕôг.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 6, in <module>
matplotlib.pyplot.figure(figsize=(6,75,3,63888888888889))
File "C:\ProgramData\Miniconda3\envs\powerBi\lib\site-packages\matplotlib\pyplot.py", line 548, in figure
**kwargs)
File "C:\ProgramData\Miniconda3\envs\powerBi\lib\site-packages\matplotlib\backend_bases.py", line 160, in new_figure_manager
fig = fig_cls(*args, **kwargs)
File "C:\ProgramData\Miniconda3\envs\powerBi\lib\site-packages\matplotlib\figure.py", line 361, in __init__
self.bbox_inches = Bbox.from_bounds(0, 0, *figsize)
TypeError: from_bounds() takes 4 positional arguments but 6 were given
OS Version:
Microsoft Windows NT 10.0.17134.0 (x64 sv-SE)
CLR Version:
4.7 or later [Release Number = 461808]
Peak Virtual Memory:
38.2 GB
Private Memory:
511 MB
Peak Working Set:
684 MB
IE Version:
11.165.17134.0
User ID:
07052a05-5aaa-46fc-8527-45318116ac05
Workbook Package Info:
1* - sv-SE, Query Groups: 0, fastCombine: Disabled, runBackgroundAnalysis: True.
Telemetry Enabled:
True
Model Default Mode:
Import
Snapshot Trace Logs:
C:\Users\hesu\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot1979732988.zip
Performance Trace Logs:
C:\Users\hesu\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip
Enabled Preview Features:
PBI_PythonSupportEnabled
Disabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_newFromWeb
PBI_SpanishLinguisticsEnabled
CustomConnectors
PBI_variationUIChange
PBI_canvasTooltips
PBI_showIncrementalRefreshPolicy
PBI_compositeModels
PBI_DB2DQ
Disabled DirectQuery Options:
PBI_DirectQuery_Unrestricted
TreatHanaAsRelationalSource
Cloud:
GlobalCloud
DPI Scale:
100%
Supported Services:
Power BI
Formulas:
section Section1;
shared #"train (1)" = let
Source = Csv.Document(File.Contents("C:\Users\hesu\Downloads\train (1).csv"),[Delimiter=",", Columns=81, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Id", Int64.Type}, {"MSSubClass", Int64.Type}, {"MSZoning", type text}, {"LotFrontage", type text}, {"LotArea", Int64.Type}, {"Street", type text}, {"Alley", type text}, {"LotShape", type text}, {"LandContour", type text}, {"Utilities", type text}, {"LotConfig", type text}, {"LandSlope", type text}, {"Neighborhood", type text}, {"Condition1", type text}, {"Condition2", type text}, {"BldgType", type text}, {"HouseStyle", type text}, {"OverallQual", Int64.Type}, {"OverallCond", Int64.Type}, {"YearBuilt", Int64.Type}, {"YearRemodAdd", Int64.Type}, {"RoofStyle", type text}, {"RoofMatl", type text}, {"Exterior1st", type text}, {"Exterior2nd", type text}, {"MasVnrType", type text}, {"MasVnrArea", Int64.Type}, {"ExterQual", type text}, {"ExterCond", type text}, {"Foundation", type text}, {"BsmtQual", type text}, {"BsmtCond", type text}, {"BsmtExposure", type text}, {"BsmtFinType1", type text}, {"BsmtFinSF1", Int64.Type}, {"BsmtFinType2", type text}, {"BsmtFinSF2", Int64.Type}, {"BsmtUnfSF", Int64.Type}, {"TotalBsmtSF", Int64.Type}, {"Heating", type text}, {"HeatingQC", type text}, {"CentralAir", type text}, {"Electrical", type text}, {"1stFlrSF", Int64.Type}, {"2ndFlrSF", Int64.Type}, {"LowQualFinSF", Int64.Type}, {"GrLivArea", Int64.Type}, {"BsmtFullBath", Int64.Type}, {"BsmtHalfBath", Int64.Type}, {"FullBath", Int64.Type}, {"HalfBath", Int64.Type}, {"BedroomAbvGr", Int64.Type}, {"KitchenAbvGr", Int64.Type}, {"KitchenQual", type text}, {"TotRmsAbvGrd", Int64.Type}, {"Functional", type text}, {"Fireplaces", Int64.Type}, {"FireplaceQu", type text}, {"GarageType", type text}, {"GarageYrBlt", type text}, {"GarageFinish", type text}, {"GarageCars", Int64.Type}, {"GarageArea", Int64.Type}, {"GarageQual", type text}, {"GarageCond", type text}, {"PavedDrive", type text}, {"WoodDeckSF", Int64.Type}, {"OpenPorchSF", Int64.Type}, {"EnclosedPorch", Int64.Type}, {"3SsnPorch", Int64.Type}, {"ScreenPorch", Int64.Type}, {"PoolArea", Int64.Type}, {"PoolQC", type text}, {"Fence", type text}, {"MiscFeature", type text}, {"MiscVal", Int64.Type}, {"MoSold", Int64.Type}, {"YrSold", Int64.Type}, {"SaleType", type text}, {"SaleCondition", type text}, {"SalePrice", Int64.Type}})
in
#"Changed Type";