Die Suche ergab 6 Treffer

von geopython
Mittwoch 8. August 2018, 23:27
Forum: Wissenschaftliches Rechnen
Thema: CSV-Datei einlesen - Error could not convert string to float
Antworten: 16
Zugriffe: 5085

Re: CSV-Datei einlesen - Error could not convert string to float

Optimal wäre es natürlich wenn sowohl Datum und Uhrzeit auf der x-Achse stehen, mit einem Intervall von ca. 6 h.
Nein, die Daten sollen nicht aggregiert werden. Jeder einzelne Wert soll im Diagramm angezeigt werden und die Beschriftung dann halt im Intervall von 6h.
mit "datetime" könnte man ja ...
von geopython
Mittwoch 8. August 2018, 21:05
Forum: Wissenschaftliches Rechnen
Thema: CSV-Datei einlesen - Error could not convert string to float
Antworten: 16
Zugriffe: 5085

Re: CSV-Datei einlesen - Error could not convert string to float

Wie man dem Code u.U., entnehmen kann, möchte ich ein (Linien)Diagramm erstellen. Auf der x-Achse das Datum und auf der y-Achse die Menge. Der Wert "07.08.2014" stellt somit das Datum dar. Das Datum bzw. der Wert "07.08.2014" steht in meiner Textdatei in der Spalte "Datum".
Offensichtlich gibt es ...
von geopython
Mittwoch 8. August 2018, 11:12
Forum: Wissenschaftliches Rechnen
Thema: CSV-Datei einlesen - Error could not convert string to float
Antworten: 16
Zugriffe: 5085

Re: CSV-Datei einlesen - Error could not convert string to float

Habe den Code mit dem delimiter angepasst und zwar wie folgt:

import matplotlib as mlp
import matplotlib.pyplot as plt
import pandas as panda
import numpy as np

x,y= np.loadtxt(r"C:\Users\0\Desktop\Test.txt", unpack = True, delimiter =' , ', skiprows = 1)



plt.title("Test", fontsize=24)
plt ...
von geopython
Mittwoch 8. August 2018, 00:10
Forum: Wissenschaftliches Rechnen
Thema: CSV-Datei einlesen - Error could not convert string to float
Antworten: 16
Zugriffe: 5085

Re: CSV-Datei einlesen - Error could not convert string to float

Vielen Dank schonmal.
Ich hab einiges ausprobiert, deswegen ist da was durcheinander gekommen. Sorry
Code:

import matplotlib as mlp
import matplotlib.pyplot as plt
import pandas as panda
import numpy as np

x,y= np.loadtxt('r"C:\Users\0\Desktop\Test.txt", unpack = True, skiprows = 1)

'''
print(x ...
von geopython
Dienstag 7. August 2018, 23:36
Forum: Wissenschaftliches Rechnen
Thema: CSV-Datei einlesen - Error could not convert string to float
Antworten: 16
Zugriffe: 5085

Re: CSV-Datei einlesen - Error could not convert string to float

Vielen Dank schonmal für eure Ideen.
Ich habe die Datei nun zu UTF-8 ohne BOM konvertiert.
(Der COde von_deets_ hat leider nicht funktioniert, bin aber auch nicht wirklich bewand in solchen Python-Codes)
Nach der Konvertierung habe ich das Skript nochmal gestartet und bekomme nun folgende ...
von geopython
Dienstag 7. August 2018, 22:41
Forum: Wissenschaftliches Rechnen
Thema: CSV-Datei einlesen - Error could not convert string to float
Antworten: 16
Zugriffe: 5085

CSV-Datei einlesen - Error could not convert string to float

Hallöchen,

ich brauche etwas Hilfe. Ich habe eine CSV-Datei bzw habe es auch schon als Textdatei probiert - es ändert nichts am Fehler.
Folgenden vereinfachten Code habe ich:

import matplotlib as mlp
import matplotlib.pyplot as plt
import pandas as panda
import numpy as np

x,y= np.loadtxt('Test ...