Skip to content
Advertisement

Pandas dataframe custom formatting string to time

I have a dataframe that looks like this I need to get every value in this column DEP_TIME to have the format hh:mm. All cells are of type string and can remain that type. Some cells are only missing the colon (rows 0 to 3), others are also missing the leading 0 (rows 4+). Some cells are empty and should

Dictionary from list comprehension

I have a following list. I found dictionary keys, which is the first item in the tuple. From there, I created a dictionary, whose values are the tuples from the first list if the first item in the tuple matches with the keys defined previously. Then I created a new list whose elements are tuples based on the dictionary values.

Kafka with python: How to send topic to postgreSQL?

I am urged to use Kafka with python. Moreover, I need to develop a very simple producer-consumer application that reads metrics from a device in real-time and then publishes them to a topic ‘metrics’ in Kafka. Then a consumer must subscribe to the ‘metrics’ topic and store those data to a postgreSQL database. I tried to draw the architecture here:

Django Form does not save properly

I want to create a comment system. I can take username, doc_id, and comp_name, but I cannot get the comment_others. I think there is a problem saving the form. How can I fix it? views.py models.py forms.py template.html And there are two forms on the same page. When I save this form, the other form disappears. Why it could be

Split a dataframe based on a specifc cumsum value

I have a solution working, but it seems cumbersome and I am wondering if there is a better way to achieve what I want. I need to achieve two things: Split a dataframe into two dataframes based on a specifc cumsum value. If a row needs to be split to fulfill the cumsum condition, than this must happen. An example

Advertisement