Skip to content

Instantly share code, notes, and snippets.

@pjastr
Created May 9, 2019 14:28
Show Gist options
  • Save pjastr/6b14cff48e5f1eea14ae2076dd79d4aa to your computer and use it in GitHub Desktop.
Save pjastr/6b14cff48e5f1eea14ae2076dd79d4aa to your computer and use it in GitHub Desktop.
import pandas as pd

data = {
    "Miasto": ['Olsztyn', 'Warszawa'],
    "Temperatura": ["Prognoza", "Aktualna"],
    "Sty-2015": [2, -5],
    "Lut-2015": [-3, 4],
    "Mar-2015": [5, 12]
}

data2 = pd.DataFrame(data)
data3 = pd.melt(data2, id_vars=["Miasto", "Temperatura"], var_name="Data", value_name="Wartość")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment