Created
October 25, 2017 15:03
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
# Einlesen der Datei | |
training_data = pandas.read_csv("data/numerai_training_data.csv") | |
# Die ersten 5 Zeilen samt Header ausgeben | |
print(training_data.head()) | |
# Aus wie vielen Zeilen und Spalten besteht die Datei? | |
print(training_data.shape) | |
# Wir wollen nur die ID, Datentyp und den Wert für Feature 1&2 | |
important_data = training_data[["id","data_type", "feature1", "feature2"]] | |
# Schauen wir uns den Aufbau jetzt an, wir erwarten nat. 4 Spalten | |
print(important_data.shape) | |
# Welche Datentypen gibt es? | |
print(important_data.data_type.unique()) | |
# Wie ist der Durchschnittswert von feature1? | |
print(important_data.feature1.mean()) | |
# Speichern wir die Summe aus feature 1&2 als neue Spalte: | |
new_frame = important_data.copy() | |
new_frame.loc[:,"sum"] = important_data.feature1+important_data.feature2 | |
# und wir prüfen das mal schnell: | |
print(new_frame.head()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment