예제 #1
0
 def testTimeZone(self):
     id = py3k.b('Europe/Berlin')
     timeZone = QTimeZone(id)
     self.assertTrue(timeZone.isValid())
     self.assertEqual(timeZone.id(), id)
     name = timeZone.displayName(QTimeZone.GenericTime, QTimeZone.DefaultName)
     self.assertTrue(name)
예제 #2
0
def read_data(fname):

    # Read the CSV content

    df = pd.read_csv(fname)


    # Remove wrong magnitudes

    df = df.drop(df[df.mag < 0].index)

    magnitudes = df["mag"]


    # My local timezone

    timezone = QTimeZone(b"Europe/Berlin")


    # Get timestamp transformed to our timezone

    times = df["time"].apply(lambda x: transform_date(x, timezone))


    return times, magnitudes
예제 #3
0
def read_data(fname):
    df = pd.read_csv(fname)
    df = df.drop(df[df.mag < 0].index)
    magnitudes = df["mag"]
    timezone = QTimeZone(b"Europe/Berlin")
    times = df["time"].apply(lambda x: transform_date(x, timezone))
    return times, magnitudes
예제 #4
0
def read_data(file_name):
    df = pd.read_csv(file_name)

    timezone = QTimeZone(b"North America")

    times = df["submitted"].apply(lambda x: transform_date(x, timezone))

    return times
예제 #5
0
def read_data(fname):
    i_data = pd.read_csv(fname)

    i_data = i_data.drop(i_data[i_data.mag < 0].index)
    magnitudes = i_data["mag"]

    timezone = QTimeZone(b"Asia/Singapore")

    times = i_data["time"].apply(lambda x: transform_date(x, timezone))

    return times, magnitudes
예제 #6
0
def read_data(fname):
    # Read the csv data
    df = pd.read_csv(fname)

    # Remove incorrect magnitudes
    df = df.drop(df[df.mag < 0].index)
    magnitudes = df["mag"]

    # Local timezone
    timezone = QTimeZone(b"Europe/Berlin")

    # Get timestamps transformed to local timezone
    times = df["time"].apply(lambda x: transform_date(x, timezone))
    return times, magnitudes
예제 #7
0
def read_data(csv_filepath):
    # Read the CSV content.
    df = pd.read_csv(csv_filepath)

    # Remove wrong magnitudes.
    df = df.drop(df[df.mag < 0].index)
    magnitudes = df['mag']

    # My local timezone.
    timezone = QTimeZone(b'Europe/Berlin')

    # Get timestamp transformed to our timezone.
    times = df['time'].apply(lambda x: transform_date(x, timezone))

    return times, magnitudes
    def read_data(self, fname):
        # read the csv content
        df = pd.read_csv(fname)

        # remove wrong magnitudes
        df = df.drop(df[df.mag < 0].index)
        magnitudes = df["mag"]

        # my local timezone
        timezone = QTimeZone(b"Europe/Berlin")

        # get the timestamp transfered to our timezone
        times = df["time"].apply(lambda x: self.transform_date(x, timezone))

        return times, magnitudes
예제 #9
0
def read_data(fname):
    # Считать содержимое CSV
    df = pd.read_csv(fname)
    """df-переменная содержащая данные файла, в нее их закачивает метод read_csv(), если csv изменить Exel то csv не работает
    fname-параметр, у нас в программе это путь к файлу
    """

    # Удалить неправильные величины
    df = df.drop(df[df.mag < 0].index)
    magnitudes = df["mag"]
    """в список magnitudes записываются из столбца mag"""

    #  Мой местный часовой пояс
    timezone = QTimeZone(b"Europe/Berlin")

    # Получить временную метку, преобразованную в наш часовой пояс
    times = df["time"].apply(lambda x: transform_date(x, timezone))
    """запускается функция transform_date """

    depth = df["depth"]
    """ в depth записываются значения из столбца"depth" """

    return times, magnitudes, depth