"matplotlib csv-datei anpassen und verwenden" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "matplotlib csv-datei anpassen und verwenden" answered properly. Developers are finding an appropriate answer about matplotlib csv-datei anpassen und verwenden related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like matplotlib csv-datei anpassen und verwenden. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on matplotlib csv-datei anpassen und verwenden.
matplotlib csv-datei anpassen und verwenden
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Ehescheidungen in Kiel
Der vollständige Datensatz wird im Open-Data-Portal der Stadt Kiel zum Download bereitgestellt:
https://www.kiel.de/opendata/kiel_bevoelkerung_ehescheidungen.csv
Version: 1.0
Python 3.7
Date created: 25.02.2019
'''
# Bibliotheken importieren
import pandas as pd
import matplotlib.pyplot as plt
# CSV-Datei lesen (Dataframe => df) erzeugen
csv_data = 'kiel_ehescheidungen_modified.csv'
df = pd.read_csv(csv_data, encoding='latin1', sep=';', header=None,
names=['Land', 'Stadt', 'Jahr', 'Kategorie', 'Merkmal', 'Ehescheidungen'])
# Die ersten fünf Zeilen ausgeben
print(df.head())
# Zeilen mit fehlenden Werten (NaN) entfernen
df_cleaned = df.dropna()
x = df_cleaned['Jahr'].values
y = df_cleaned['Ehescheidungen'].values
# Subplot erstellen
fig, ax = plt.subplots()
# Beschriftungen hinzufügen
plt.title("Ehescheidungen in Kiel", size="x-large")
plt.ylabel("Anzahl", size="x-large")
plt.xlabel("Jahr", size="x-large")
# Aussehen der x-Achse festlegen
ax.set_xticks(range(len(x)))
ax.set_xticklabels(x, rotation='vertical')
# y-Achse, Legende
plt.plot(y, "r*-", markersize=6, linewidth=1, color='r', label="Scheidungen")
plt.legend(loc=(0.6, 0.8))
plt.show()
Source: bodo-schoenfeld.de
All those coders who are working on the Whatever based application and are stuck on matplotlib csv-datei anpassen und verwenden can get a collection of related answers to their query. Programmers need to enter their query on matplotlib csv-datei anpassen und verwenden related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about matplotlib csv-datei anpassen und verwenden for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of matplotlib csv-datei anpassen und verwenden while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "matplotlib csv-datei anpassen und verwenden". Visit this developer's friendly online web community, CodeProZone, and get your queries like matplotlib csv-datei anpassen und verwenden resolved professionally and stay updated to the latest Whatever updates.