Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, i am working with a CSV file that contains the date and corresponding precipitation. I would like to write the Julian day of year

Hello, i am working with a CSV file that contains the date and corresponding precipitation. I would like to write the Julian day of year (from 1-365) for each date. What i have so far is this:

import pandas as pd

import numpy as np

from pandas import read_csv

from obspy.core import UTCDateTime

data=pd.read_csv('script.csv')

date = np.array(data[['DATE']])

prcp = np.array(data[['PRCP']])

julday= []

for i in range(len(date)):

year= date[i][0].split('-')[0]

month= date[i][0].split('-')[1]

day= date[i][0].split('-')[2]

newdate= UTCDateTime(int(year), int(month), int(day))

julday.append(newdate.julday)

This is giving me values from 1-- 365, but it is repeated over and over again. I dont know if i am thinking about this problem correctly. Any help/advice?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+ Is the theme appropriate?

Answered: 1 week ago

Question

Compose the six common types of social business messages.

Answered: 1 week ago

Question

Describe positive and neutral messages.

Answered: 1 week ago